HP Forums

Full Version: Truncate decimal part of angle (DEG)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi,
what's the command to truncate the decimal part of an angle (DEG format).
I mean: I've 3°12'22".12345 and I want 3°12'22" without the .12345
Using IP() I get 3°00'00", with truncate() I get 3°12'22.12345" ...

thank you,
Salvo
For that specific example, 3°12′22.12345″, this works:

LEFT(STRING(3°12′22.12345″),7) --> "3°12′22"

You can probably figure out a more general approach.
(06-18-2015 11:47 AM)DrD Wrote: [ -> ]For that specific example, 3°12′22.12345″, this works:

LEFT(STRING(3°12′22.12345″),7) --> "3°12′22"

You can probably figure out a more general approach.

good idea, Dale, thank you. I'm thinking about it...
This should work with any angle:

→HMS((IP(HMS→(3°12′22.12345″)*3600)/3600))
(06-18-2015 12:11 PM)Didier Lachieze Wrote: [ -> ]This should work with any angle:

→HMS((IP(HMS→(3°12′22.12345″)*3600)/3600))

simple, but great!
it works, thank you.

Salvo
Reference URL's