forked from BigfootDev/flatbuffers
Do not remove the last digit from float values (#5974)
Trailing zeros are already removed inside the function FloatToString, that is called immediately before the lines deleted by this commit.
This commit is contained in:
@@ -3285,10 +3285,6 @@ bool FieldDef::Deserialize(Parser &parser, const reflection::Field *field) {
|
||||
value.constant = NumToString(field->default_integer());
|
||||
} else if (IsFloat(value.type.base_type)) {
|
||||
value.constant = FloatToString(field->default_real(), 16);
|
||||
size_t last_zero = value.constant.find_last_not_of('0');
|
||||
if (last_zero != std::string::npos && last_zero != 0) {
|
||||
value.constant.erase(last_zero, std::string::npos);
|
||||
}
|
||||
}
|
||||
deprecated = field->deprecated();
|
||||
required = field->required();
|
||||
|
||||
Reference in New Issue
Block a user