How to change decimal to currency by using script ?

shiva narayana
Kilo Contributor

How to change decimal to  currency  by using script ?

Like 

3456 to 3,456

4 REPLIES 4

Saiganeshraja
Kilo Sage
Kilo Sage
g_form.setValue('currency field name', currency_code + ';' + currency_amount);

currency_code is the code of the currency example $ - USD currency_amount is the decimal value.

Mark correct and helpful

Hello 

Thank you for response

it is showing Like this USD;2569

I want the convert decimal number to currency

250000 this is to be convert like 2,50,000

 

that "currency_code" + ';' + currency_amount really does work on my situation, thanks.

DrewW
Mega Sage
Mega Sage

So depending on what/why/when then google is your friend.

https://sebhastian.com/javascript-format-number-commas/

Otherwise if you are trying to set a form value Saiganeshraja has you covered.