Decimal places in HTML template

andysayers909

05-07-2018

We're configuring some new email templates. As we populate these emails with a price, we're looking for these to be set at 2 decimal places including pence, E.g. £100.00.

The values in the data fed in to the template are to two decimal points, but the HTML is showing the data without the trailing zero, E.g. £101.7

How do we get round this?

Regards,

Andy

Accepted Solutions (1)

Accepted Solutions (1)

ananya_kuthiala

Employee

05-07-2018

Hello andysayers909

You may try using js script function Math.round(num * 100) / 100 or parseFloat(Math.round(num3 * 100) / 100).toFixed(2);

Similar issue has been resolved in Re: Getting 2 decimal places

Regards,

Ananya Kuthiala