]> gitweb.factorcode.org Git - factor.git/commit
formatting, workaround bug for "%.0e" and "%.0f" on windows
authorJon Harper <jon.harper87@gmail.com>
Thu, 6 Jul 2017 22:21:38 +0000 (00:21 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Sat, 8 Jul 2017 16:40:08 +0000 (18:40 +0200)
commite470a5bb284bf4ebe8fd61f29bcb5b69f4cd9b8a
tree6696544d7738f01e3c2e3e480dd7edaab5e1580a
parent7c2e964fc9e86858724e740b0d1909b6162dde99
formatting, workaround bug for "%.0e" and "%.0f" on windows

On windows, the underlying formatting implementation
uses a precison of 6 when asked to do a precision of 0.
Improve the post-processing so that it doesn't fully break
the formatted number. The previous implementation would change
"1.00000" to "10000", and 1.00000e0 to 10000e0...

With this, windows has a different formatting for "%.0f" and "%.0e"
but at least it's the right number
basis/formatting/formatting-tests.factor
basis/formatting/formatting.factor