Truncate decimal part of angle (DEG)
06-18-2015, 10:28 AM
Post: #1
 salvomic Senior Member Posts: 1,396 Joined: Jan 2015
Truncate decimal part of angle (DEG)
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

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
06-18-2015, 11:47 AM (This post was last modified: 06-18-2015 11:49 AM by DrD.)
Post: #2
 DrD Senior Member Posts: 1,133 Joined: Feb 2014
RE: Truncate decimal part of angle (DEG)
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:59 AM
Post: #3
 salvomic Senior Member Posts: 1,396 Joined: Jan 2015
RE: Truncate decimal part of angle (DEG)
(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...

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
06-18-2015, 12:11 PM
Post: #4
 Didier Lachieze Senior Member Posts: 1,602 Joined: Dec 2013
RE: Truncate decimal part of angle (DEG)
This should work with any angle:

→HMS((IP(HMS→(3°12′22.12345″)*3600)/3600))
06-18-2015, 12:14 PM
Post: #5
 salvomic Senior Member Posts: 1,396 Joined: Jan 2015
RE: Truncate decimal part of angle (DEG)
(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

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)