Skip to content

Commit 02787fc

Browse files
authored
When the latitude or longitude is negative, the value recorded was in the format -x.-xxxxxxx
Update gpsrecord.cpp (#333)
1 parent b7da06e commit 02787fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gpsrecord.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ String GpsRecord::toScaledString(const int32_t value, const uint16_t scale) {
115115
}
116116
char buffer[32];
117117
const int32_t scl = pow10[scale];
118-
snprintf(buffer, sizeof(buffer), "%d.%0*d", value / scl, scale, value % scl );
118+
snprintf(buffer, sizeof(buffer), "%d.%0*d", value / scl, scale, abs(value % scl) );
119119
return String(buffer);
120120
}
121121

0 commit comments

Comments
 (0)