Jump to content

automatically add variable number of hyphens to the end of a text calculation


This topic is 4359 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I am currently using one of the layouts in filemaker to print checks.

my check layout has a calculation field that converts the numerical value of the check to a verbal representation of the number ie: $100.56

is translated into One Hundred Dollars and fifty six cents. I will refer to this field as numtranslate from now on.

I would like to create a calculation field refered to as "checkline" from now on, that uses the value from numtranslate and intelligently adds a variable number of hyphens to strike through any remaining white space on the number word line on the check automatically, without having a fixed number of hyphens present so that it does not distort the text printout beyond the constraints of the "Number space"allotted on the check form.

My ideal structure for Checkline would look like a calc field that specifies max characters or variable defined at value maxVar. The field would display numtranslate followed by a variable number of hyphens as specified by the calculation (character count of numtranslate - MaxVar)

so that the end result looks like:

One Hundred Dollars and fifty six cents--------------------------------------------------------------------------

or

Fifteen Dollars and Zero Cents-------------------------------------------------------------------------------------

or

Ten Dollars and One Cent -------------------------------------------------------------------------------------------

I need a little help creating this formula, and would appreciate any help anybody can offer. Thanks

Link to comment
Share on other sites

will this work for you?

The problem with declaring value max with is that it is very dependent on the layout and font used, a monospace font and a proportional font using the same calculation will break

in the example provided i'd recommend creating a calc field for known areas where the value is going to be displayed you then know that this field is used for a particular layout & font.

checkText.fp7.zip

Link to comment
Share on other sites

This topic is 4359 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.