Skip to content Skip to sidebar Skip to footer

toFixed in Javascript / jQuery

     To set the precision of floating point number we can use this method, we can set how many degits come after the dot(.).

Syntax
(floating point value).toFixed(digit count)

Example
(2.3336).toFixed(2)  =>  2.33
(2.3336).toFixed(1)  => 2.3
(18.12598415150005).toFixed(3)   => 18.125



Example Program:- (Editor)


Editor is Loading...

Advertisement

Post a Comment for "toFixed in Javascript / jQuery"