Forum Discussion
HappilyCreative
3 years agoCommunity Member
How to Get Two Decimal Places or Cut Decimals with JavaScript in Storyline?
Hi,
I am trying to figure out how to get my number variable to either have two decimal places, or simply have the decimals cut and just round to the nearest whole number. I was able to achieve ge...
Jürgen_Schoene_
3 years agoCommunity Member
try
var number = 12344556567.1264567;
var ret = number.toLocaleString('en-US', { maximumFractionDigits: 2 })
console.log( ret );
result: "12,344,556,567.13"