Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR switches%.10g
formatting decimal with a precision limited to 4 digits after the.
.[Changing my mind: using
stringstream
with no relevant figures limitation]This applies to
@tstamp
or@tstamp2
, for example, and avoids the trailing zeros. See previous discussions here and thereThe output will be
tstamp="1"
ortstamp="1.75"
instead oftstamp="1.0000"
ortstamp="1.7500"
respectively.This implementation avoids the use ofstringstream
, which I find over the top. It sets an arbitrary limit to 10 significant numbers - if the value is larger that999,999
, then the number of digits after the.
will be reduced. We can adjust the value (or even change to stringstream) if a case where the loss would have an impact can be identified, but this looks quite unrealistic to me.