Javascript examples for Date Operation:Date Calculation
Calculate sum of hours decimal
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from ww w . java2 s.c o m*/ sum = 7.9 sum = sum.toString().split("."); console.log(sum); sum = parseFloat(sum[0]) + parseFloat( parseInt(sum[1])>6 ? 1+(parseInt(sum[1])-6)/10 : sum[1] ); console.log(sum); } </script> </head> <body> </body> </html>