0

In javascript I'm multiplying the price of item and quantity to display its total. For example: the item price be 48.00 and quantity is 3. If I multiply them in javascript, I'm getting the value like 144. But, I want as 144.00
Thanks in advance

2 Answers2

1

I use this:

var nr = 48.00 * 3;
alert( nr.toFixed(2) );
Federico
  • 1,231
  • 9
  • 13
0

Here is a library I have been using for some time

http://phpjs.org/functions/number_format/

It is a reproduction of the php number_format into js

David Laberge
  • 15,435
  • 14
  • 53
  • 83