I have a requirement where I should allow 0 after number and decimal number
Is there a way that I can let the user to show the number in $1.0
in this way and decimal number like $1.5
in $1.50
using JavaScript.
I tried this but it did not help me
addZero: function (q)
{
alert(q);
//var a = ("0" + q).slice(-2);
return q;
}
But I don't know how to add 0 after number and after decimal number using JavaScript.