1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-14 14:33:07 +01:00

Formater fixed for XDR data

This commit is contained in:
norbert-walter
2022-03-02 22:12:21 +01:00
parent 3bc1068c14
commit b29e3a972b

View File

@@ -372,8 +372,16 @@ FormatedData formatValue(GwApi::BoatValue *value, CommonData &commondata){
}
}
else{
snprintf(buffer,bsize,"%3.0f",value->value);
result.unit = "";
if(value->value < 10){
snprintf(buffer,bsize,"%2.1f",value->value);
}
if(value->value >= 10 && value->value < 100){
snprintf(buffer,bsize,"%3.1f",value->value);
}
if(value->value >= 100){
snprintf(buffer,bsize,"%3.0f",value->value);
}
result.unit = "";
}
buffer[bsize]=0;
result.svalue = String(buffer);