Mega Code Archive

 
Categories / JavaScript Tutorial / Number Data Type
 

Adding the float point numbers together

< html> <head> <title>GoodAdd</title> </head> <body> <script> var meal; meal = 123.45; meal = eval(meal); var tip = meal * .15; var total = meal + tip; alert ("the meal is $" + meal); alert ("the tip is $" + tip); alert ("Total bill: $" + total); </script> </body> </html>