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

New Participant
May 1, 2020 8:16 AM UTC

Hi

I want to convert UAE currency in words i.e 10,199.55 (Ten Thousand One Hundred Ninety-nine & Fils Fifty-five Only) is there anybody who can tell me how to do the same.

 

Regards

 

Polson

Translate
wackronie
New Participant
Aug 26, 2015 5:32 AM UTC

This works great how , could the same be working for 3 decimals , it tried to convert to string and read the value with right function , but it fails as soon as there is number ends with zeros .Please help .

Grandtotal.format.picture.value = "z,zzz,zz9.999"

var x = wordnum(numtoword)

var y  = Right(Grandtotal, 3)

y = wordnum(y)

this.rawValue = Concat(x," Currency And ",Subcurrency," Fils")

Translate
Level 2
May 31, 2013 2:56 PM UTC

it works very well

Translate
Level 2
May 17, 2013 1:21 PM UTC

sir,

it only work if we converts the value from 100000 to 120000 but as well as we move further like 120001 it gets fail & converts the value in usual manner i.e. one hundred twenty thousand one only

regards

uma shankar

Translate
Employee
May 12, 2013 4:43 PM UTC

Y = Replace(Y,"hundred thousand", "lac");

Translate
Level 2
May 11, 2013 4:14 AM UTC

Sir,

One more thing i would like to know that how i can set the digit terms in form calculation (i.e. if i have put a figure 100,000 the output come as one hundred thousand instead of one lac ) i have set the digit for lac but it only convert the value of 100000 when i went further it converts the value as usual like two hundred thousand,three hundred thousand. What would be the solution for that. I also have two numeric fields will it work for both fields if yes then what changes should be made in the script so that i can get the results.

regards

uma shankar

Translate
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.

Translate
New Participant
Mar 24, 2023 11:50 AM UTC

worked successfully.
After trying various methods, found your post.
Thanks a lot

Translate
Level 2
May 10, 2013 5:48 AM UTC

rest is perfect or need some altration

Translate
Employee
May 10, 2013 5:38 AM UTC

Instead of using the statement:

var Y,Z;

Use

var Y;

var Z;

i.e. you need to split up the var declarations. Thisi s not javascript but formcalc and hence, this nuance.

This should do it!

-Saket.

Translate
Level 2
May 10, 2013 5:26 AM UTC

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);

Translate