Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RMC FixTime parsing that can lose sub-second precision with doubles #117

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

justinswork
Copy link

When calling AddSeconds on the DateTimeOffset, in .NET 6 it rounds the double to the closest millisecond value. However, this changed in .NET 7. https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/7.0/datetime-add-precision

Regardless of whether or not this package adds .NET 7 support, this change will ensure that we don't lose any subsecond precision from the NMEA message.

For NMEA messages that have less than 3 digits of precision, this will not change any behavior
"$GPRMC,141825.2,A,4249.92297,N,08548.52186,W,000.01,227.1,040322,005.5,W*54"

But for NMEA messages with more than 3 digits of precision, this will preserve that precision.
"$GPRMC,141825.1999,A,4249.92297,N,08548.52186,W,000.01,227.1,040322,005.5,W*54"

@justinswork
Copy link
Author

#116

@justinswork
Copy link
Author

@dotMorten we would appreciate this getting in soon so we can make the switch to .NET 8. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant