You can try with toFixed
method on a float
/integer
value:
var value = 0.127456;
value.toFixed(2);
Output:
0.13
In your case:
jQuery(".content").html("£" + lineCost.toFixed(2));
If lineCost
is a string, parse it to float:
jQuery(".content").html("£" + parseFloat(lineCost).toFixed(2));