Skip to content

Setting precision for double results in exponencial notation #435

Answered by zeux
ShaiWavesAudio asked this question in Q&A
Discussion options

You must be logged in to vote

pugixml simply uses sprintf with %g specifier to format numbers, so that's the behavior there - it switches between scientific and regular notations based on the estimated output length. If you want consistent non-scientific output you can format the numbers externally using sprintf or stringstream, and then use set with const char* argument instead of double.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zeux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #434 on August 07, 2021 16:47.