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

[strformat] Zero-padding does not work with floats #7932

Closed
kaushalmodi opened this Issue May 31, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@kaushalmodi
Copy link
Contributor

kaushalmodi commented May 31, 2018

Hello,

Here's a small snippet that shows this issue:

import strformat
echo fmt"{15:08}" # int, works
echo fmt"{1.5:08}" # float, does not work
echo fmt"{1.5:0>8}" # workaround using fill char works for positive floats
echo fmt"{-1.5:0>8}" # even that does not work for negative floats

Output:

00000015
     1.5
000001.5
0000-1.5
@kaushalmodi

This comment has been minimized.

Copy link
Contributor

kaushalmodi commented Jun 2, 2018

Thanks for the PR @skilchen! Closing this as this was fixed in 07ff994.

@kaushalmodi kaushalmodi closed this Jun 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment