PHP Function:
JavaScript
x
function formatNumberForDisplay($number, $decimal=0, $decimalSeperator='.', $numberSeperator=',')
{
return number_format($number, $decimal, $decimalSeperator, $numberSeperator);
}
Can anybody suggest to me the equivalent functionality in jQuery/JavaScript?
Advertisement
Answer
is this what you’d like to get?
JavaScript
yourFloatVarHere.toFixed(2);
voilà.