I tested with 134.9982 and 134.99982 and the calculation returns the same for both which is
"One Hundred Thirty Four Dollars and Ninety Nine cents".
I copied the calculation from the link you provided, then I pasted the calculation in MSWord, then I replaced Numberfield with Amount. (Amount is the field in my database) then I copy from word and pasted into AmountToWord calculation field in FM.
Using this custom function
And changing the field the calculation is on to this:
numToText (Round( NumberField;2) ) //result: Text,
NumToText: One Hundred Thirty Five Dollars
The problem is that my amount field has rounded (correctly) to $135.00. Since this is on a check, the discrepency has been noted and I've been asked to correct it.
This is an issue with your amount field not the convert amount to text. Add auto-enter calculation on your amount field. Check the Calculated value then set round(Self;2) as the calculation, then uncheck do not replace existing value of field. This will change round the number to $135.00
Here is sample database Dropbox - DollarToWords.fmp12
I had done that before your suggestion. It works in your example, but not in mine. It looks like my process and script to get an amount in the first place needs tweaking. Thanks to everyone for your quick and thoughtful responses.