Formater fixed for XDR data
This commit is contained in:
parent
3bc1068c14
commit
b29e3a972b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue