Possible Duplicate:
Javascript: formatting a rounded number to N decimals
I’m modifying a label text using JavaScript
I need to format that label text in the form (ex: 45.00).
Now it is being displayed as (45)
How can I achieve this from client side
To accomplish this from server side, I’m doing – lb.Text = String.Format(“{0:0.00}”, rondedamount);
I need this from client side (Inside Label) or from JavaScript.
this may work for you :
The toFixed() method converts a number into a string, keeping a specified number of decimals.
where the toPrecision, Returns a string representing a Number object in fixed-point or exponential notation rounded to precision significant digits.