Skip to content

Commit 5406a65

Browse files
committed
Merge pull request arduino#313 from tekka007/precisionfix
Limiting max. precision in dtostrf()
2 parents 862c584 + 3d8fbdf commit 5406a65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/MySensors/core/MyMessage.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ char* MyMessage::getString(char *buffer) const {
100100
} else if (payloadType == P_ULONG32) {
101101
ultoa(ulValue, buffer, 10);
102102
} else if (payloadType == P_FLOAT32) {
103-
dtostrf(fValue,2,fPrecision,buffer);
103+
dtostrf(fValue,2,min(fPrecision, 8),buffer);
104104
} else if (payloadType == P_CUSTOM) {
105105
return getCustomString(buffer);
106106
}

0 commit comments

Comments
 (0)