Javascript examples for Data Type:Float
Get the number which when multiplied will give you the closest to a target number
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w . j av a 2 s.com*/ function findFactor(a, b) { return Math.floor(a / parseFloat(b)); } console.log(findFactor(2062, 0.75)) } </script> </head> <body> </body> </html>