Originally Posted by kanna443
0.25 -15 Minutes
0.50 -30 Minutes
0.75 -45 Minutes
1.00 -60 Minutes
1.25 -75 Minutes
as per above scenario I got total time as 100.25 in my text field. i have to convert as no of Day(s) no of hour(s) no of Minute(s)
can any one help on this
Hmmm. I get the idea that you ought to be able to code this simple conversion yourself. Did you even try?
var hours = 108.75;
var days = Math.floor(hours/24);
hrs = Math.floor(hours%24);
var decimal = hours - Math.floor(hours);
var minutes = Math.round(decimal * 60);
alert (hours + " hours is equal to " + days + " days " + hrs + " hours " + minutes + " minutes")
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Last edited by Philip M; 03-15-2013 at 09:56 AM..