-
Notifications
You must be signed in to change notification settings - Fork 944
New issue
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
Float's are truncated #913
Comments
|
Ok - I get the same as you in node In the browser i get |
Right so the browser implementation is actually more correct. We target |
That makes sense. Probably should be in the README.
FWIW I checked %.06f in browser --- It didn't understand
…On Fri, Sep 23, 2022 at 3:56 PM Qix ***@***.***> wrote:
Right so the browser implementation is actually *more* correct. We target
printf()'s specifiers. %d means "integer". %f means "floating point
number". I don't remember if debug understands %.06f (it's been a while)
but that would be the way to specify precision.
—
Reply to this email directly, view it on GitHub
<#913 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGNDXPFQVC2FS5HZEIO3V7WZHPANCNFSM6AAAAAAQTYCDVY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
PR welcome. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
%d
formatter coerces any floating point number such as0.3123
to an integer.The documentation should mention this.
The only way I could find to print the full number is to use
%o
.It would be nice to have better printf style control e.g.
%d3
to print 3 sig figures.The text was updated successfully, but these errors were encountered: