Bug 17715 – Floating point numbers are printed as integers

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2017-08-03T16:08:10Z
Last change time
2024-12-01T16:30:41Z
Assigned to
No Owner
Creator
pgkos.bugzilla
Moved to GitHub: phobos#10260 →

Comments

Comment #0 by pgkos.bugzilla — 2017-08-03T16:08:10Z
Currently, this example: writeln(10000.01); prints just "10000", probably because the call to snprintf inside phobos/format.d formatValue implementation for floats uses "%g" by default. It would be nice if the default formatter was e.g.: %.8g for float type %.16g for double type
Comment #1 by robert.schadek — 2024-12-01T16:30:41Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10260 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB