I'm working in the HTML for an email creative, trying to force a number field <%= targetData.price %> to two decimal places. It comes through as the lowest number of decimals at the moment ("9" or "12.5". I've used formatDate before, but can't seem to find anything on formatting numbers.
1. Create a span element in the HTML where you want to print the price for eg.
Here is the product price: <span id="productPrice"></span>
var productPrice=<%= targetData.price %>;
var productPriceDecimalLimit=productPrice.toFixed(2); /// Here 2 is the deimal places