## Turning the decimal point OFF

### Turning the decimal point OFF

I have a program that is obtaining and printing degrees, minutes, and seconds of lat/lon coordinates. I use decimal seconds to three places, but degrees and minutes are integers.

When I put these numbers into the alpha register for printing in FIX 0, the trailing decimal point remains. So the output string looks stupid: 78. 19. 10.354 NORTH

Short of doing string manipulation on each number, is there a way to turn OFF the radix marker altogether so integers look like integers?

Thanks in advance for any ideas.
ScottJ
.....

Posts: 15
Joined: Fri Feb 12, 2021 1:08 am

### Re: Turning the decimal point OFF

CF 29 after FIX 0 will suppress the decimal point.
dlachieze
......

Posts: 23
Joined: Wed Mar 11, 2009 9:39 am

### Re: Turning the decimal point OFF

dlachieze wrote:CF 29 after FIX 0 will suppress the decimal point.

Thanks much!
ScottJ
.....

Posts: 15
Joined: Fri Feb 12, 2021 1:08 am

### Re: Turning the decimal point OFF

Worked perfectly! One more question: is there a quick and dirty way to add a leading zero? My test program output looks like the attached. The minutes look weird as single digits.
Attachments
ScottJ
.....

Posts: 15
Joined: Fri Feb 12, 2021 1:08 am

### Re: Turning the decimal point OFF

ScottJ wrote:One more question: is there a quick and dirty way to add a leading zero?

Assuming that the minutes are in the X register, you can insert the following instructions before the ARCL of the minutes value:

Code: Select all
`10x<=y?GTO 01CLXARCL ST XLBL 01RDN`
dlachieze
......

Posts: 23
Joined: Wed Mar 11, 2009 9:39 am

### Re: Turning the decimal point OFF

dlachieze wrote:Assuming that the minutes are in the X register, [...]
... and assuming FIX 0 is already set and ScottJ uses an HP41CX or has at least plugged in a Time module I suggest to shorten the shown proposal to
Code: Select all
`ATIME24`

Code: Select all
`10x>y?"~0"RDN`

with "~0" connoting to append literal "0". (I am about to waste much more time with this append than the improvement could ever save.)

A clear word to ScottJ about the statement WITHIN 136.8 M -- even if the m stand for meter not miles, it is more than the longer side of a football/soccer field. For such a "precise" position fix the tolerance shown to the 1/10th of a meter is a bit too much meticulous. Same for the three decimals of the seconds. The earth's circumference is (according the original definition of the meter, over the poles) 40'000 km, divided by 360° is the "length" of one degree on the surface, divided by 60 the length of a minute (looks like a nautical mile), divided by 60 the length of one second, three decimal places depict a "granulation" of 1/1000th of it -- or less than 1/4000th of the 136.8 M variance.
mike-stgt
.........

Posts: 78
Joined: Tue Dec 24, 2019 12:12 pm