You are here: irt.org | About | Feedback | 5267 [ previous next ]
Feedback on:
irt.org FAQ Knowledge Base Q6
Sent by
Pauan on Wednesday May 07, 2008 at 01:20:05
Worth:
Worth reading
Length:
Too long
Technical:
Too technical
Comments:
A far easier method is to simply use the toFixed method.
<script type="text/javascript">
var money = 100.50;
document.write(money.toFixed(2));
</script>
The above script will display the variable "money" with a fixed decimal point 2 away, displaying the number 100.50. If you give a toFixed value of 4 instead, the displayed number would be 100.5000.
Other feedback on 'irt.org FAQ Knowledge Base Q6' - show all