When i was working on core php project and i need to work with float value. Like i require to fixed decimal point with two digit after point. So i did search on google and found the tofixed() of javascript. But when i try and checked on my fire but, it say tofixed() is not a function. I thought what was wrong and i did try many way.
However, Finally i got what is issue and found the best solution. But i did simply use like as bellow example:
var myVal = $(".myfloat").val();
myVal = myVal.tofixed(2);
But above code was not working because i require to use "parseFloat" before use tofixed(), So i did simply use as bellow code:
Solution:
var myVal = $(".myfloat").val();
myVal = parseFloat(myVal).tofixed(2);
I hope you found your solution....
Do you like below Tutorials ?
- PHP Laravel 5.5 - import export data into excel and csv using maatwebsite
- Laravel 7.x and 6.x create custom facade example from scratch
- Node JS - Get Real time online users counter using socket io example
- PHP Laravel 7.x and 6.x - Bootstrap Admin Theme Integration example from scratch
- MySQL Query - How to select records of today to next Sunday ?
- Laravel 7.x and 6.x - username custom validation example
- Laravel 5.5 - Import Extract zip file using chumper/zipper package
- PHP Laravel Set Custom Validation Error Messages Example