Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Expressing numbers as text

Avatar

Former Community Member

Hello!

I need to write a function to return a numeric value (price) as text, that is, if the user types 1,500 the text field should read One Thousand Five Hundred.

So I imagine the best choice for this would be Acrobat JavaScript, right? I suppose FormCalc is more focused on numeric calculations.

As this scenario is pretty common place, I wonder if I could find this script ready somewhere. 

Thank you very much for any ideas!

Marcos

1 Accepted Solution

Avatar

Correct answer by
Level 10

Actually FormCalc has an easy way to do this with the WordNum function.

The most basic form is WordNum(theNumber) but there are other options, you might want to grab the FormCalc reference to see how it works:

http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf

If you prefer JavaScript I did a quick Google search on "javascript numbers to words" and there are a lot of hits.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Actually FormCalc has an easy way to do this with the WordNum function.

The most basic form is WordNum(theNumber) but there are other options, you might want to grab the FormCalc reference to see how it works:

http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf

If you prefer JavaScript I did a quick Google search on "javascript numbers to words" and there are a lot of hits.

Avatar

Former Community Member

Sounds promissing, thanks!

The only difference is I need this in Portuguese.

So after I get the string all I need to do is replace English words with the Portuguese equivalent.

Nice!

Thank you!

Marcos

UPDATE: Reading the pdf, just found out about the LOCALE option! GREAT!!