convert currency values in words | Adobe Higher Education
Skip to main content
Level 2
May 7, 2013
Beantwortet

convert currency values in words

  • May 7, 2013
  • 19 Antworten
  • 19643 Ansichten

i wants to convert indian currency in words i.e 199 (rupees one hundred ninety nine only) is there anybody who can tell me how to do the same

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von SaketSidana

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.

19 Antworten

Adobe Employee
May 7, 2013

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

Level 2
May 7, 2013

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

Adobe Employee
May 7, 2013

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.

Level 2
May 7, 2013

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

uma shankar

Adobe Employee
May 7, 2013

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.

Level 2
May 8, 2013

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

Adobe Employee
May 8, 2013

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;

Level 2
May 9, 2013

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

Adobe Employee
May 9, 2013

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.

Level 2
May 10, 2013

sir,

i have tried the currency formula which you have mentioned earlier in your reply i found that the variable which we have declared in the script editor the programme gives an error at line no. 2 column no. 6 which is variable y i am attaching the error file anong with the code which i have putted into it.

This is the code which i have putted into script writer

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

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

var Y,Z;

Z = RTGS_AMT.rawValue;

AMT_WORDS.rawValue= WordNum(Z,2);

Y = AMT_WORDS.rawValue;

Y = Replace(Y,"Dollers","Rupees");

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

AMT_WORDS.rawValue = Y;

AMT_WORDS = WordNum(RTGS_AMT,Z,2);