Limiting max. precision in dtostrf()
This commit is contained in:
@@ -100,7 +100,7 @@ char* MyMessage::getString(char *buffer) const {
|
|||||||
} else if (payloadType == P_ULONG32) {
|
} else if (payloadType == P_ULONG32) {
|
||||||
ultoa(ulValue, buffer, 10);
|
ultoa(ulValue, buffer, 10);
|
||||||
} else if (payloadType == P_FLOAT32) {
|
} else if (payloadType == P_FLOAT32) {
|
||||||
dtostrf(fValue,2,fPrecision,buffer);
|
dtostrf(fValue,2,min(fPrecision, 8),buffer);
|
||||||
} else if (payloadType == P_CUSTOM) {
|
} else if (payloadType == P_CUSTOM) {
|
||||||
return getCustomString(buffer);
|
return getCustomString(buffer);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user