Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Numbers to words calc

Featured Replies

Previously in FM5 I used a series of case statements to transform numbers to words for numbers up to 9999. Is there an easier way in FM7 with the Let function? I guess I'm a bit burned out today and hope that I don't have to reinvent the wheel, if someone has already done it. Thanks

Here's one that was a CF by Don Wieland. There are others around but some require CF because they use recursion. I'd just give you the link to it, but I can't find it now on Brian Dunning's site. I think this calc can be shortened quite a bit but I haven't had time.

Choose(Int(Mod(Dollars;10^12) / 10^11); ""; "One Hundred "; "Two Hundred "; "Three Hundred "; "Four Hundred "; "Five Hundred "; "Six Hundred "; "Seven Hundred "; "Eight Hundred "; "Nine Hundred ")

&

If(Int(Mod(Dollars;10^11) / 10^10) = 1; Choose(Int(Mod(Dollars;10^10) / 10^9); "Ten "; "Eleven "; "Twelve "; "Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen "); Choose(Int(Mod(Dollars;10^11) / 10^10); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ")

&

Choose(Int(Mod(Dollars;10^10) / 10^9); ""; "One "; "Two "; "Three "; "Four "; "Five "; "Six "; "Seven "; "Eight "; "Nine ")) &

Case(Int(Mod(Dollars;10^12)/10^9) and Int(Mod(Dollars;10^9) / 10^3); "Billion, "; Int(Mod(Dollars;10^12)/10^9);"Billion ";"")

& Choose(Int(Mod(Dollars;10^9) / 10^8); ""; "One Hundred "; "Two Hundred "; "Three Hundred "; "Four Hundred "; "Five Hundred "; "Six Hundred "; "Seven Hundred "; "Eight Hundred "; "Nine Hundred ")

& If(Int(Mod(Dollars;10^8) / 10^7) = 1; Choose(Int(Mod(Dollars;10^7) / 10^6); "Ten "; "Eleven "; "Twelve "; "Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen ");

Choose(Int(Mod(Dollars;10^8) / 10^7); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ")

& Choose(Int(Mod(Dollars;10^7) / 10^6); ""; "One "; "Two "; "Three "; "Four "; "Five "; "Six "; "Seven "; "Eight "; "Nine ")) & Case(Int(Mod(Dollars;10^9)/10^6) and Int(Mod(Dollars;10^6) / 10^3); "Million, "; Int(Mod(Dollars;10^9)/10^6);"Million ";"")

& Choose(Int(Mod(Dollars;10^6) / 10^5); ""; "One Hundred "; "Two Hundred "; "Three Hundred "; "Four Hundred "; "Five Hundred "; "Six Hundred "; "Seven Hundred "; "Eight Hundred "; "Nine Hundred ")

& If(Int(Mod(Dollars;10^5) / 10^4) = 1;

Choose(Int(Mod(Dollars;10^4) / 10^3); "Ten "; "Eleven "; "Twelve "; "Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen "); Choose(Int(Mod(Dollars;10^5) / 10^4); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ") &

Choose(Int(Mod(Dollars;10^4) / 10^3); ""; "One "; "Two "; "Three "; "Four "; "Five "; "Six "; "Seven "; "Eight "; "Nine "))

& Case(Int(Mod(Dollars;10^6)/10^3) and Int(Mod(Dollars;10^3) / 10^0); "Thousand, "; Int(Mod(Dollars;10^6)/10^3);"Thousand ";"")

& Choose(Int(Mod(Dollars;10^3) / 100); ""; "One Hundred "; "Two Hundred "; "Three Hundred "; "Four Hundred "; "Five Hundred "; "Six Hundred "; "Seven Hundred "; "Eight Hundred "; "Nine Hundred ")

&

If(Int(Mod(Dollars;100) / 10) = 1; Choose(Int(Mod(Dollars;10)); "Ten "; "Eleven "; "Twelve ";

"Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen ");

Choose(Int(Mod(Dollars;100) / 10); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ") & Choose(Int(Mod(Dollars;10)); ""; "One "; "Two "; "Three "; "Four

"; "Five "; "Six "; "Seven "; "Eight "; "Nine ")) & Case(Int(Dollars) > 1; "Dollars"; Int(Dollars) = 1; "Dollar"; "")

& If(Mod(Dollars; 1) and Int(Dollars);" and ";"") &

If(Mod(Int(Dollars*10); 10) = 1; Choose(Mod(Int(Dollars*100); 10); "Ten "; "Eleven "; "Twelve ";

"Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen ");

Choose(Mod(Int(Dollars*10); 10); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ")

& Choose(Mod(Int(Dollars*100); 10); ""; "One "; "Two "; "Three ";

"Four "; "Five "; "Six "; "Seven "; "Eight "; "Nine ")) &

Case(Mod(Dollars; 1) > .01; "cents"; Mod(Dollars; 1) = .01; "cent";"")

  • Author

Thanks about 4 hours and 100 hair follicles worth, in other words, thanks a whole bunch.

(Things are things because of mind as mind is mind because of things. These two are merely relative and both at source are emptiness.)

Boy have I had days like that!! :crazy2:

What you said makes perfect sense to me. :shocked:

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.