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

Trim GGA precision for HDOP, altitude, etc to single decimal place #85

Merged
merged 5 commits into from
May 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sentences/GGA.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ module.exports = function (app) {
toNmeaDegreesLongitude(position.longitude),
ignssMethodQuality,
gnssSatellites,
gnssHorizontalDilution,
gnssAntennaAltitude,
gnssHorizontalDilution.toFixed(1),
gnssAntennaAltitude.toFixed(1),
'M',
gnssgeoidalSeparation,
gnssgeoidalSeparation.toFixed(1),
'M',
gnssDifferentialAge,
gnssDifferentialReference
Expand Down
4 changes: 2 additions & 2 deletions test/GGA.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('GGA', function() {

it('works with default values', done => {
const onEmit = (event, value) => {
assert.equal(value ,'$GPGGA,172814,3723.4659,N,12202.2696,W,0,0,0,0,M,0,M,,*45')
assert.equal(value ,'$GPGGA,172814,3723.4659,N,12202.2696,W,0,0,0.0,0.0,M,0.0,M,,*5B')
done()
}
const app = createAppWithPlugin(onEmit, 'GGA')
Expand All @@ -16,7 +16,7 @@ describe('GGA', function() {

it('works with sample values', done=> {
const onEmit = (event, value) => {
assert.equal(value ,'$GPGGA,172814,3723.4659,N,12202.2696,W,2,6,1.2,18.893,M,-25.669,M,2,0031*44')
assert.equal(value ,'$GPGGA,172814,3723.4659,N,12202.2696,W,2,6,1.2,18.9,M,-25.7,M,2,0031*41')
done()
}
const app = createAppWithPlugin(onEmit, 'GGA')
Expand Down