convert currency values in words | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SaketSidanaAccepted solution
Employee
May 10, 2013 7:20 AM UTC

Slight modifications: Spellings of dollars are incorrect which would cause incorrect replacement of the string. Also modified the code slightly. Please try it out and debug yourself.

form1.#subform[0].AMT_WORDS::exit - (FormCalc, client)

//RTGS_AMT::exit-(form calc,client)

var Y;

var Z;

Z = RTGS_AMT.rawValue;

AMT_WORDS.rawValue= WordNum(Z,2);

Y = AMT_WORDS.rawValue;

Y = Replace(Y,"Dollars","Rupees"); // changed spellings here.

Y = Replace(Y,"Cents","Paise");

AMT_WORDS.rawValue = Y;

// AMT_WORDS = WordNum(RTGS_AMT,Z,2); // This is not required.

20 replies

Employee
May 9, 2013 6:30 AM UTC

Good to know that your original issue of currency conversion is solved.

Please check your MS access installation. It's working on one of your systems, hence it must be some issue in configuration/installation.

Translate
Level 2
May 9, 2013 4:55 AM UTC

Dear sir,

i have created database of adobe livecycle form it working properly on my home pc but as well as i have coppied the same on my office pc it dosent work properly rather ms access is installed on both systems but it is not creating the database at the office pc, how do it come possible for me to proper functionality at office system, is it require the data file as well as the form on the office pc

uma shankar

Translate
Employee
May 8, 2013 7:29 AM UTC

Here's how you can do this.

"Get the value in dollars and cents using WordNum function and replace "dollar" and "cents" with "rupees" and "paise" respectively.

I have a numeric field NumericField1, TextField1 displays its value in dollars/cents and TextField2 displays rupees/paise. Try this script written on exit event on numeric field once a value is entered in numeric field. You can customize the script based on your use case.

// form1.sf1.NumericField1::exit - (FormCalc, client)

var y;

var z;

z = sf1.NumericField1.rawValue;

sf1.TextField1.rawValue= WordNum(z,2);

y = sf1.TextField1.rawValue;

y = Replace(y,"Dollars","Rupees");

y = Replace(y,"Cents","paise");

sf1.TextField2.rawValue = y;

Translate
Level 2
May 8, 2013 5:25 AM UTC

Sir,

Could you please write a simple illustrative code in reply so i can easily understand the same, it would be the greatest pleasure for me to get assisted by you

uma shankar

Translate
Employee
May 7, 2013 1:17 PM UTC

Parse the number separated through the decimal field and use WordNum function to generate strings for the resultant numbers. Eg:

Let's say you have two fields in the form. 1 numeric field which holds the value you wish to convert into words and 1 textfield where you wish to display the value. Use a script like:

sf1.TextField1.rawValue = WordNum(sf1.NumericField1)

This would give you the value of number (before the decimal) in words. Of course, you need not assign this value to a field as I did. this was just an illustration and you can use a variable in script to store values.Similarly, you can do the same for number after the decimal.

Translate
Level 2
May 7, 2013 1:01 PM UTC

how we can create the string in word num function because all the formula is inbuilt

uma shankar

Translate
Employee
May 7, 2013 12:44 PM UTC

This function is only supported for English (US) localei .e. for Dollar.

WordNum(n1 [, n2 [, k ]]) where k is the locale.

For Indian currency, you'll have to do it a bit differently.

1) Get the number in words before the decimal point using the WordNum function.

2) Get the number in words after the decimal point using the WordNum function.

Create the appropriate string by appending string "rupees" and "paise" at required places in the text field where you would be displaying the value. this is what I could think of at this point of time. Try it out. This should work.

Translate
Level 2
May 7, 2013 12:17 PM UTC

sir,

i have tried the same but it can only convert the values in dollers i need the same to convert the values in indian currency how do it come possible for me

uma shankar

Translate
Employee
May 7, 2013 11:09 AM UTC

Use the function WordNum available in Form Calc. See help page: http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=001531.html

Translate