We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The precision argument while printing a double with given precision seems to be treated as width instead.
Documentation
%.*g, print floating point number with given precision. Expect int, double
Test 1
int num_precision = 10; double num = 123.1234567891; char *s = mjson_aprintf("{%Q:%.*g}", "num", num_precision, num); printf("%s\n", s); free(s); // output: {"num":123.1234568}
Test 2
int num_precision = 13; double num = 123.1234567891; char *s = mjson_aprintf("{%Q:%.*g}", "num", num_precision, num); printf("%s\n", s); free(s); // output: {"num":123.1234567891}
The text was updated successfully, but these errors were encountered:
Generally, the %.*g is a length formater, the precission is %.2g, but seems its not implemented
%.*g
%.2g
Sorry, something went wrong.
No branches or pull requests
The precision argument while printing a double with given precision seems to be treated as width instead.
Documentation
Test 1
Test 2
The text was updated successfully, but these errors were encountered: