diff options
author | Maganty Rushyendra <mrushyendra@yahoo.com.sg> | 2020-06-03 19:47:47 +0800 |
---|---|---|
committer | Maganty Rushyendra <mrushyendra@yahoo.com.sg> | 2020-06-03 21:21:27 +0800 |
commit | b7d835d9cae8625fe32fa837bae6f3e7843f50e7 (patch) | |
tree | 10a69140af95e6116087144f3d20b92ef9e0328b /scene/2d/polygon_2d.cpp | |
parent | 901832e21c74d20689cd59a3464581467997e57c (diff) |
Enable zero padding with float specifier for format strings
Godot currently supports zero padding for integers, octals and
hexadecimals when using format strings, but not for floats.
This commit adds support for zero padding for floats, thus ensuring
consistent behavior for all types, and making Godot's format specifiers'
behavior closer to c's `printf()`.
Before: `print("<%07.2f>" % -0.2345)` prints `< -0.23>`.
Now: `print("<%07.2f>" % -0.2345)` prints `<-000.23>`.
`print("<%7.2f>" % -0.2345)` prints `< -0.23>`.
Diffstat (limited to 'scene/2d/polygon_2d.cpp')
0 files changed, 0 insertions, 0 deletions