[Xastir] Re: [Gpsd-dev] SiRF GPRMC bug? and GPGGA format

Derrick J Brashear shadow at dementia.org
Mon May 16 11:00:38 EDT 2005


On Mon, 16 May 2005, Eric S. Raymond wrote:

> Derrick J Brashear <shadow at dementia.org>:
>> So, 1) GPRMC specified 07.4f, which means a total field width of 7,
>> padded at left with zeroes, and 4 digits to the right of the .
>
> Is this really true?  I thought the field width didn't count the decimal point.

main(){
   double f = 83.55678;
   double g = 100.5;
   double h = 5.23;
   printf("%08.4f %08.4f %08.4f\n", f, g, h);
   printf("%07.4f %07.4f %07.4f\n", f, g, h);
}

083.5568 100.5000 005.2300
83.5568 100.5000 05.2300

If you zero pad 5, then you zero pad 83. 07.4f is never right. It's either 
06.4f or 08.4f.

>> 2) GPGGA should have the same padding applied.
>
> Um...why?  Does NMEA require it?

Seems like real receivers have it. What does NMEA require? Nailing it down 
seems hard. You're already zero padding in one place. Why not here?





More information about the Xastir mailing list