tesmc
asked on
XJS: add currency to price variable that contains no decimals
I have
var price =2799
var NumberOfDecimals = nodeCurrencyCode.GetAttrib ute("Numbe rOfDecimal s");
i want to update price such that it conforms to the NumberOfDecimals present.
ie. if NumberOfDecimals == 2 then price = 27.99
var price =2799
var NumberOfDecimals = nodeCurrencyCode.GetAttrib
i want to update price such that it conforms to the NumberOfDecimals present.
ie. if NumberOfDecimals == 2 then price = 27.99
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
quick question on this, if var price =2900 or var price =3040 your solution doesn't take into account the trailing zeros.
instead it outputs 29 and 30.4
I'd like 29.00 and 30.40
how can i do that?
instead it outputs 29 and 30.4
I'd like 29.00 and 30.40
how can i do that?
ASKER