HP Forums

Full Version: HMS commands
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

In an app/program I want to inputs the hexagesimal number 2.3 (02:30) and then convert it to decimal (2.5)

I see how to do this in home or cas using ->HMS(2'30") or HMS->(2'30"). But how do I make an INPUT command imbedded in the program to convert 2.30 (hrs.min) into 2.5 (decimal).

That is using old terms:

2.5             (2 hours decimal 5)
2.3 (2 hours 30 minutes)


2.3 (2 hours 30 minutes)
2.5 (2 hours decimal 5)


Edited: 14 Oct 2013, 1:43 a.m.

What type of machine are you using?

I'm pretty sure Geoff is asking for a solution on the Prime.

Yes, having trouble asking for an input on a program in a simple dceimal time representing a hexagesimal number.

best explained with an example:

Old school:


2.30 2.30
HR (HMS->) 2.50 This involves four keystrokes.

Converting back an forth was easy. Now to convert it is:

HMS->(2'30")   2.5    This involves nine keystrokes!

So in a nutshell I want the program to prompt for a hexagesimal number in the form of the old school format '2.3' and convert that to '2.5' decimal format. At the moment I need to input '2.3' by invoking the hexagesimal shift key and inputting with the tags, degrees, minutes and seconds.

Or is there a simple HMS command, (can't find it).

Cheers, Geoff

There is an HMS-> and ->HMS. Easiest way to get them for use in your program is look under the "more" category in your CMDS menu button in the editor.

If you mean readily available in a menu somewhere for use inside the input box, then no. However, there is a template item specifically for entering without needing to do shift a b/c over and over. Look in the template key (the "C" button) down in the bottom right.


Edited: 14 Oct 2013, 5:02 p.m.

thanks Tim,

i can't say it enough, i haven't had this much fun programming since the 25, 65, 67, 41C series, 71B.

Never caught on to RPL as much but this is addictive.

"If you mean readily available in a menu somewhere for use inside the input box, then no"

thats what i was trying to do ;-O

Yes I see the HMS functions, just trying to be lazy and make the code do the work.

Edited: 14 Oct 2013, 5:36 p.m.

Well, glad you are having fun.

Keep poking holes in things and hopefully it will give us more ways to make it better.