I need to convert some numbers that express time values from decimal to sexagesimal . Does anyone have a valid formula ? thanks
I need to convert some numbers that express time values from decimal to sexagesimal . Does anyone have a valid formula ? thanks
How To Convert a Decimal to Sexagesimal
http://geography.about.com/library/howto/htdegrees.htm
Does this help?
Robert
Thanks Demon, maybe I have not explained well, but I have a number of hours expressed as a decimal (eg. 2.5h - 4,23h - 1,125h) and I need to convert this number in hours: minutes: seconds (HH: MM : ss). Thank you for your help
Hi Mombassa
in PBP you will have to jump through several hoops like a circus dog
hours to seconds = hours x 3600
minutes to seconds = minutes x 60
seconds to hours = seconds /3600 with no remainder or seconds//3600 with a remainder
minutes= seconds//60 with remainder being your seconds left over
see section 4.17.2 of the manual.
you may display individual digits using DIG command sec 4.17.8
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
You will need .0001 hour resolution to get 1 second resolution.
.1 hour = 6 min.
.01 hour = 24 sec.
.001 hour = 3.6 sec
.0001 hour = .36 sec
Last edited by Dave; - 10th November 2014 at 19:07.
Dave Purola,
N8NTA
EN82fn
It would appear, from your examples, that the hours are already done. As minutes and seconds share a base of 60 parts per whole [next] unit, you really only need consider one conversion from decimal fraction (hundredths) to time based (sixtieths) - once for the fraction of hours to minutes, then again on the remainder for fractions of minutes to seconds. Some scaling will be necessary to address the integer math, but...
Fraction of an hour * 60 = minutes. Fraction of a minute * 60 = seconds.
So, if you have 1.125 hours: .125 hours * 60 = 7.5 minutes and .5 minutes * 60 = 30 seconds. 1.125 hours = 01:07:30. Again using your example of 4.23 hours:
.23 hours * 60 = 13.8 minutes. .8 minutes * 60 = 48 seconds = 04:13:48.
Perhaps I have misunderstood your OP, but it does not seem such a difficult exercise to me.
Bookmarks