Option to specify custom format for floating numbers
Is your feature request related to a problem? Please describe.
It is related to https://github.com/aaubry/YamlDotNet/issues/637. That issue was solved by changing the format from G17 to G in https://github.com/aaubry/YamlDotNet/pull/695.
But, numbers like 0.1 * 3 are still serialized as 0.30000000000000004. This is correct, but in case the YAML is used by humans, it is not user friendly.
Describe the solution you'd like
It would be great to have an option for a custom "precision" (to be able to set e.g. G16).
Describe alternatives you've considered
A workaround is "manual" rounding of the number to the required precision before serializing.
Additional context
None.
You can use the YamlFormatter which is the number/value formatter used to set that information. It should solve your needs.