How to convert numbers to text in a form created in LiveCycle Designer?

Avatar

Avatar
Validate 1
Level 1
Peter_Miles
Level 1

Like

1 like

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
Peter_Miles
Level 1

Like

1 like

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Peter_Miles
Level 1

17-06-2009

I am relatively new to Livecycle Designer and very much a newbie with JavaScript and FormCalc.  I have created a Conditional Sales Contract form and when the user enters a dollar amount (1548.95) I would like to know how to  auto fill a text field with its text equivalent ( One Thousand Five Hunderd and Fourty-eight dollars and ninety-five cents).  I have found two forums explaining how to do this in Acrobat 8 but nothing in LiveCyle Designer.   Can this be done in LiveCycle and can anyone please help me with the script?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_Bruce_Robertson
MVP

20-06-2009

Hi Peter,

You could move the WordNum function to the calculate event of the text field (might be a better place for it anyway).

So you would have something like;

WordNum(NumericField2

, 2)

Bruce

----- form1.#subform[1].DollarAmountText::calculate: - (FormCalc, client) ------------------------------

Answers (11)

Answers (11)

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_Bruce_Robertson
MVP

18-03-2010

I see what you mean, very annoying.  I can only guess you could try something really hacky like;

Replace(Replace(Replace(Replace(WordNum(x,2

), "Dollars ",""), "Dollar ",""), "Cents", ""), "Cent", "")

Sorry

Bruce

Avatar

15-03-2010

Hi,

    Using the WordNum formcalc function, how can i get the output without the "Dollars" and "cents"?

thanks,

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_Bruce_Robertson
MVP

17-06-2009

FormCalc has a WordNum function that will do this.  So maybe on the exit event of the dollar amount field you could have;

DollarAmountText

= WordNum($ , 2)

Where DollarAmountText is the field to show the text equivalent. "$" is FormCalc's way of referring to the current field and "2" means monetary value with cents.

Avatar

Avatar
Validate 1
Level 1
JainSa
Level 1

Likes

2 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Validate 1
Level 1
JainSa
Level 1

Likes

2 likes

Total Posts

9 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 1
View profile
JainSa
Level 1

29-03-2018

Hi I'm new to learn Live cycle Designer and very much a newbie with JavaScript and Form Calc.  I have created a Manual form(Amount and Amount in word) in amount Field entered value (100000 INR) I would like to know how to  auto fill a text field with its text equivalent ( One lakhs only).

But the value come Different :One Hundred Thousand only.(I think this is Us Relevant,but I don't need this.i want India Format)

I wrote code in Formcalc:

Concat(WordNum(amount),space(1),"Only").

then try WordNum(amount)


Avatar

Avatar
Level 1
clina12345
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
clina12345
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
clina12345
Level 1

10-07-2013

Hi Bruce,

Can I add prefix and suffix to the converted text?

eg.  "SAY US ONE HUNDRED SIXTY THOUSAND DOLLARS AND SIXTY FIVE CENTS ONLY."

Can I make the converted text auto upper case?

Thanks

Jay

Avatar

18-03-2010

Hey Bruce,

   thanks man. the replace works great.  i dont mind being hacky .

thanks again,

Avatar

16-03-2010

Hi Bruce,

    Yes, but this will not also print in words any figure after the decimal. i.e. Amount = 1.25, with wordmum(Amount), the output is One. i want it to print One and Twenty Five as it should.

with wordnum(amount, argument), i get "dollars" and "cents" in the output. can i get the output without "dollars" and "cents" as part of the output.

thanks in advance.

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_Bruce_Robertson
MVP

16-03-2010

Hi stejpal,

Just leave of the second argument, that is just use WordNum(NumericField2)

Bruce

Avatar

Avatar
Validate 1
Level 1
Peter_Miles
Level 1

Like

1 like

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
Peter_Miles
Level 1

Like

1 like

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Peter_Miles
Level 1

22-06-2009

Thanks very much for your help Bruce that's done it!!

Avatar

Avatar
Validate 1
Level 1
Peter_Miles
Level 1

Like

1 like

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
Peter_Miles
Level 1

Like

1 like

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Peter_Miles
Level 1

18-06-2009

Thanks for the help, I can see how that FormCalc script works on exiting a field where the dollor number has been entered but what do I need to add to it in a field where the amount has been simply carried forward from a calculated field.  Currently in this number field is:

----- form1.#subform[1].DollarAmount::calculate: - (FormCalc, client) ------------------------------

NumericField1[8]

Avatar

Avatar
Level 1
zahirhussain
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
zahirhussain
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
zahirhussain
Level 1

30-08-2020

how to convert words to numbers using adobe