Formater fixed for XDR data

This commit is contained in:
norbert-walter 2022-03-02 22:12:21 +01:00
parent 3bc1068c14
commit b29e3a972b
1 changed files with 10 additions and 2 deletions

View File

@ -372,7 +372,15 @@ FormatedData formatValue(GwApi::BoatValue *value, CommonData &commondata){
}
}
else{
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;