Closed mrdalgaard closed 2 years ago
Note that it isn't the int conversion that is the problem. Storing it as a float is the issue. Try printing the float version back. My guess is that you'll get:
>> 184105.000
184104.0
Note that it isn't the int conversion that is the problem. Storing it as a float is the issue. Try printing the float version back. My guess is that you'll get:
>> 184105.000 184104.0
I actually don't:
>>> 184105.000
184105.0
>>> int(184105.000)
184104
>>> int(184105.0)
184105
:exploding_head:
NMEA timestamp is written as HHMMSS.sss, which is stored as float in the module.
Later it is converted to int which is inaccurate: See example:
This is then math'ed into the fields in time_struct.
Propose storing the NMEA sentence as string instead, and grabbing the sections of the sting directly.