Math. fround() function in JavaScript

HTMLJavascriptFront End TechnologyWeb Development

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
raja
Published on 29-Oct-2018 10:01:35
Advertisements