convert simple c# method to jquery
double myNumber;
myNumber.ToString("0.:#0").Replace(".", "");
Could someone tel开发者_高级运维l me the equivalent jquery function?
Sorry not to good with jquery.
Thanks,
jQuery is not necessary for this and actually doesn't have number formatting methods (unless you use a plugin).
I would do it like this just using native JavaScript:
var myNumber;
myNumber.toFixed(2).replace(".", ":");
The toFixed()
method allows you to specify the number digits after the decimal place.
精彩评论