i want to convert number into decimal from jquery. like if use enter 15 then it should be converted into 15.00 or if user enter 15.5647 then 15.56.
var span = $(this).find("span");
var input = $(this).find("input");
span.html(input.val());
I tried with span.html(input.val().toFixed(2)); but it is throwing exception
JavaScript runtime error: Object doesn't support property or method 'toFixed'