Avatar

Correct answer by
Community Advisor

Hello @JonMay1 

 

You can use the javascript to limit the decimal 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>

2. Then in the javascript you can do this.

<script>
var productPrice=<%= targetData.price %>;
var productPriceDecimalLimit=productPrice.toFixed(2); /// Here 2 is the deimal places
document.getElementById('productPrice').innerHTML=productPriceDecimalLimit;
</script>

 

Let me know if that works.

 

 

View solution in original post