ConvertMoneyToWords ( )

Function stats

Average user rating
4.0000
34
129
9999
Support
FileMaker 7.0 +
Date posted
09 December 2008
Last updated
23 December 2008
Version
Recursive function
Yes

Author Info
 The Shadow

22 functions

Average Rating 4.3

author_avatar



 

Function overview

Prototype

ConvertMoneyToWords  ( amount )


Parameters

amount  The amount of money (in dollars)


Description

Tags:  Money   Format   Checkwriting  

Converts a dollar amount into words for a check-writing system.

The text is all lower-case, some people might prefer the output in proper case, which is easy to do:
Proper( ConvertMoneyToWords( 567.87 ) )

It supports more money than you will ever have to write a check for.

Examples

Sample input

97906317437.15


Sample output

ninety-seven billion nine hundred six million three hundred seventeen thousand four hundred thirty-seven dollars and 15/100

 

Function code

Let( [ roundedAmount = Round( amount; 2 ); dollars = Div(roundedAmount;1); cents = (Mod(roundedAmount;1) * 100) ];
If (dollars = 0; "zero"; ConvertIntToWords ( dollars; 10^15 )) & " dollars and "
& If (cents = 0; "no"; cents ) & "/100"
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/129

    Prototype: ConvertMoneyToWords( amount )
    Function Author: The Shadow (http://www.fmfunctions.com/mid/34)
    Last updated: 23 December 2008
    Version: 1.3

*/
// ===================================

 

Comments

Delta Tango
09 March 2009



This is awesome!!!! I instantly saw check writing when I read the description!
  General comment
daChetah90
20 July 2014



On first try this function kept returning a ?. Upon closer inspection I realized I was passing a negative amount. Once I fixed this it worked perfectly.
  General comment
David Moyer
13 September 2016



Hi, not to be an ass, but I don't see how this is recursive. The function called is "ConvertIntToWords" - not the same.
 Bug report