Math. fround() function in JavaScript


The fround() function of the Math object accepts a floating point number and returns the nearest 32-bit single precision float representation of a Number. If the given number itself is an integer this function returns the same.

Syntax

Its Syntax is as follows

Math.fround(160.98)

Example

 Live Demo

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var result = Math.fround(160.98);
      document.write("Fround value: "+result);
   </script>
</body>
</html>

Output

Fround value: 160.97999572753906

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 25-Jun-2020

173 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements