Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Expressing numbers as text

Avatar

Level 5

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

Level 5

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!!