If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

How to limit number display

I'm a cut and paste script guy and play with variables, but write no code.

I'm using a count up script that I want to set how many digits / numbers are displayed. The variables use large numbers and for this particular display I want to use three digits and a decimal, e.g. 16.5 versus 16.00000000000000.

Since the method count.toFixed(n) transform a number in a string with n digits after the point, while count=Math.floor(count*Math.pow(10,n))/Math.pow(10,n); preserve a number with at most n digits after the point.