My Html
<div class="product-line">
<a href="#" alt="close" class="btn-close" title="Remove"><img alt="remove" src="img/close.png" /></a>
<input class="input-text" name="product-code" type="text" placeholder="Product Code" />
<input class="input-text" name="product-quantity" type="text" placeholder="Quantity" />
<input class="input-text" name="product-discript" type="text" placeholder="Discription of Product" disabled />
<label class="label-sign">£</label>
<input class="input-text price" name="product-price" type="text" placeholder="RRP Price" disabled />
<br>
</div>
My JS code line
price = $(this).parent("div.product-line").find("input[name=product-price]").val( Number(price).toFixed(2) * quantity )
Basically if I multiply for example 40.2 quantity 3, i get something like 120.600000000.... How can i restrict it to 2 decimal points.
The data is coming in via JSON (made by someone else).
I am a JS newbie