Decimal round number
I have the following output numbers from product prices:
<span class="amount">77.08</span> <span class="amount">18.18</span> <span class="amount">20.25</span> I always want to round them regardless of price, so the result in this case will be:
<span class="amount">78</span> <span class="amount">19</span> <span class="amount">21</span> I tried with this code, but it just removes the integer:
jQuery('.amount').each(function () { jQuery(this).html(Math.round(parseFloat(jQuery(this).html()))); }); Any idea where the problem is?
+5