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 ?
- Angular Use CKEditor Example Tutorial
- How to Use Multiple Select Dropdown in Laravel?
- Angular 9 Image Upload with Crop Example
- Files Upload on Button Click in PHP Dropzone Example
- PHP Dropzone Allow only One File to Upload Example
- PHP Dropzone Allow only Images to Upload Example
- PHP Dropzone Delete Uploaded File Example
- Livewire CRUD Laravel 7 Example