PDA

View Full Version : concat a $ sign



nikko50
Oct 17th, 2009, 12:40 AM
So how do add a dollar sign the the front of total??


total = round_decimals(order_total, 2)
total = "$" + total;

glenngv
Oct 17th, 2009, 12:58 AM
That's correct. But as Philip suggested in the other thread, you don't have to reinvent the wheel. Just use toFixed(2) to round the values to 2 decimal places.


total = "$" + order_total.toFixed(2);

nikko50
Oct 17th, 2009, 01:07 AM
Thanks again to you and Philip!