views:

130

answers:

1

I have the jQuery numberformatter-plugin installed, but don´t get it to work correctly. I cannot find the correct commands on the net.

I want to format the value of a text field, which contains a number with two decimal places (like 0.16), to display 4 decimal places (0.1600).

A: 

You don't need any plugins for that:

var value = value.toFixed(4); // Cuts number to 4 decimal places (doesn't do rounding)
Tatu Ulmanen
Thanks, though the problem was a little different than described,this helped fixing it.
Jan-Frederik Carl