aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-09-17 00:41:26 +0200
committerLemonBoy <thatlemon@gmail.com>2020-09-17 00:53:08 +0200
commit27adb82fda516e95c3c03df80a95b895969fdd56 (patch)
treed906389a448b260b4c64bf101fab822944ed4105 /src
parentbb9a4ad6e903ad2f9c137bca56bdf2dd6fc65d03 (diff)
downloadzig-27adb82fda516e95c3c03df80a95b895969fdd56.tar.gz
zig-27adb82fda516e95c3c03df80a95b895969fdd56.zip
std: Respect user-specified alignment when formatting ints
This implementation tries to do the right thing (TM) by treating the sign as part of the number itself, therefore the alignment parameter applies to both the sign and the digits. In other words the format string `{:>4}` with -1 as input will not output `- 1` but ` -1`. And let's default to right alignment for everything as that's what users want, especially when printing numbers. Many implementations use different defaults for numeric vs non-numeric types, let's strive for a consistent behaviour here.
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions