mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-22 10:13:06 +01:00
Formater fixed for XDR data
This commit is contained in:
@@ -372,8 +372,16 @@ FormatedData formatValue(GwApi::BoatValue *value, CommonData &commondata){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
snprintf(buffer,bsize,"%3.0f",value->value);
|
if(value->value < 10){
|
||||||
result.unit = "";
|
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;
|
buffer[bsize]=0;
|
||||||
result.svalue = String(buffer);
|
result.svalue = String(buffer);
|
||||||
|
|||||||
Reference in New Issue
Block a user