Currently any float/double with no decimal component gets emitted as an integer.
float a = 1.0;
YAML::Emitter emitter;
// regardless of the Precision manipulator
emitter << YAML::Precision(2) << a;
// outputs 1
Is there a way to make it output 1.0?
The YAML file I'm emitting should have a mix of ints and floats, which gets parsed by an external script. That script needs to be able to distinguish floats and ints.
Currently any float/double with no decimal component gets emitted as an integer.
Is there a way to make it output
1.0
?The YAML file I'm emitting should have a mix of ints and floats, which gets parsed by an external script. That script needs to be able to distinguish floats and ints.