Jump 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.

converting the data inside the text field

Featured Replies

Hi everyone please help me i have a text field containing "my 18th birthday" i want this to convert in "my eighteenth birthday" thank you  :yep:

 

How high in numbers do you want to take this. i.e. teens, 20s 30s 100s, etc.?

 

You can use the Substitute Function as long as you don't go too high, say the first 20 numbers.

 

Above that, you would need a modification of the calculation at FMI (linked above). I feel that as Entry Level user, someone with experience would probably need to assist you in that?

 

Here is a demo file showing the two calculations and their results.

chadski021.fmp12.zip

  • Author

Thank you  doughemi and Lee Smith for the reply :)

 

I created a new field named CCconvert for the conversion of the number i used this calculation:

 

CCname(text field) :: "my 18th birthday"

 

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

If(Int(Mod((GetAsNumber(CCname);100) / 10) = 1;
Choose(Int(Mod((GetAsNumber(CCname);10)); "Ten "; "Eleven "; "Twelve "; "Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen ");
Choose(Int(Mod((GetAsNumber(CCname);100) / 10); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ") &
Choose(Int(Mod((GetAsNumber(CCname);10)); ""; "One "; "Two "; "Three "; "Four "; "Five "; "Six "; "Seven "; "Eight "; "Nine ")) & Case(Int((GetAsNumber(CCname)) > 1; ""; Int((GetAsNumber(CCname)) = 1; ""; "")
 
When i used this calculation the result in CCconvert field only show  "Eighteen".
My question is how can i show the text "my Eighteenth birthday"? Do i need to create a new field to show this?
 
Thank you.

CCconvert =

 

let([

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

If(Int(Mod((GetAsNumber(CCname);100) / 10) = 1;
Choose(Int(Mod((GetAsNumber(CCname);10)); "Ten "; "Eleven "; "Twelve "; "Thirteen "; "Fourteen "; "Fifteen "; "Sixteen "; "Seventeen "; "Eighteen "; "Nineteen ");
Choose(Int(Mod((GetAsNumber(CCname);100) / 10); ""; ""; "Twenty "; "Thirty "; "Forty "; "Fifty "; "Sixty "; "Seventy "; "Eighty "; "Ninety ") &
Choose(Int(Mod((GetAsNumber(CCname);10)); ""; "One "; "Two "; "Three "; "Four "; "Five "; "Six "; "Seven "; "Eight "; "Nine ")) & Case(Int((GetAsNumber(CCname)) > 1; ""; Int((GetAsNumber(CCname)) = 1; ""; "")];
Substitute(CCname; GetAsNumber(CCname); bigHairyCalc)// <--this is how you get the calc into the text
)
 
Note that this calc will fail if the number ends in 1, 2, or 3 -- 22nd will return "twenty-twond" instead of "twenty-second".  Lee's example is relevant, and a table of all desired numbers with the exceptions declared literally and the rest calculated may be the answer depending on the range you need.  Perhaps it's time you shared in what context this is going to be used.
  • 2 weeks later...
  • Author

Hello Doughemi

 

the number im converting is base on the address number 

i think the number range is between 1-1000th is there a easy one to convert the numbers accurately 

  • Author

It helps but when i enter 20th it should be twentieth not twenty 

Oops.  Attachment revised in post #7

  • 2 weeks later...
  • Author

Hello doughemi im using the same calculation in database but its not producing any inputs i used also

onobject exit

Since you have 12 Advanced, use the Script Debugger (Tools->Script Debugger) to step through the script to see if variables and fields are set or not.

Create an account or sign in to comment

Important Information

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

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.