### Title

Printing Check Payments

### Post

I am working on a portion of database that will be used to print checks. All is well thus far, aside from a slight roadblock - spelling out the amount of the payment. Any suggestions to approaching this?

Printing Check Payments

I am working on a portion of database that will be used to print checks. All is well thus far, aside from a slight roadblock - spelling out the amount of the payment. Any suggestions to approaching this?

http://www.briandunning.com/cf/106

Case(NumberIn = 0; "";

Let ( [

FullNumber = GetAsNumber( numberin );

Number = Int( FullNumber );

len = If ( Number = 0 ; 0 ; Int(Log(Number)) + 1 )

] ;

Case(len > 15;

"Out of Range";

Currency = "EvalOnly";

Let([

Hundred = Left(number; 1);

TensOnes = Right(number; 2);

TONum = GetAsNumber(TensOnes);

Tens = Left(TensOnes; 1);

Ones = If( TONum < 20; TensOnes; Right(TensOnes; 1))

];

Case(len = 3;

Choose(hundred; ""; "One"; "Two"; "Three"; "Four "; "Five"; "Six"; "Seven"; "Eight"; "Nine") & " Hundred" & Case(TONum≠0;" "))

& Case(TONum > 19;

Choose(tens; ""; ""; "Twenty"; "Thirty"; "Forty"; "Fifty"; "Sixty"; "Seventy"; "Eighty"; "Ninety") & Case(Ones ≠ 0; " "))

& Choose(ones; ""; "One"; "Two"; "Three"; "Four "; "Five"; "Six"; "Seven"; "Eight"; "Nine"; "Ten"; "Eleven"; "Twelve"; "Thirteen"; "Fourteen"; "Fifteen"; "Sixteen"; "Seventeen"; "Eighteen"; "Nineteen")

);

Case(len >3;

Let([

UseLeft = Choose(Mod(len; 3);3; 1; 2);

NewLen= 10 ^ (len - UseLeft);

ThisValue = Div(number; NewLen);

NewValue = Number - ThisValue * NewLen

];

NumberInWords ( ThisValue; "EvalOnly"; "None" ) & " " & Choose( Div(len - 1; 3); ""; "Thousand"; "Million"; "Billion"; "Trillion" ) & Case(NewValue ≠ 0;" " & NumberInWords(NewValue; ""; "None"))

);

len = 0; "Zero" ;

NumberInWords(Number; "EvalOnly"; "None")) & Case(currency ≠ ""; " " & Currency)

& Case(DecimalCurr ≠ "None"; " and "

& Let(

Decimal = Int(100 * (fullnumber - number));

If(Decimal = 0; "Zero"; NumberInWords(Decimal; "EvalOnly"; "None"))) & " " & DecimalCurr))

))

I have never done this myself, but a quick google search offers a few places to start.

http://fmforums.com/forum/topic/23991-number-to-words-calc-100-one-hundred/

http://en.allexperts.com/q/Filemaker-2117/convert-number-text-string.htm

http://help.filemaker.com/app/answers/detail/a_id/2860/~/converting-numbers-to-words-or-numbers-to-text