Javascript examples for Operator:Arithmetic Operator
Divide number with decimals
<html> <head></head> <body> <p id="demo">Click the button to see result</p> <button onclick="myFunction(3856,3)">Try it</button> <script> function myFunction(number,divide) { var money = number / divide;//from w w w . ja v a 2 s . co m money = Math.ceil(money * 100) / 100; console.log(money); //1285.34 } </script> </body> </html>