File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
tests/std/tests/P0645R10_text_formatting_formatting Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -2145,6 +2145,8 @@ _NODISCARD _OutputIt _Fmt_write(
2145
2145
case 'g':
2146
2146
if (_Precision == -1) {
2147
2147
_Precision = 6;
2148
+ } else if (_Precision == 0) {
2149
+ _Precision = 1;
2148
2150
}
2149
2151
_Format = chars_format::general;
2150
2152
break;
Original file line number Diff line number Diff line change @@ -835,6 +835,7 @@ void test_float_specs() {
835
835
assert (format (STR (" {:3}" ), Float{0 }) == STR (" 0" ));
836
836
assert (format (STR (" {:#9G}" ), Float{12.2 }) == STR (" 12.2000" ));
837
837
assert (format (STR (" {:#12g}" ), Float{1'000'000 }) == STR (" 1.00000e+06" ));
838
+ assert (format (STR (" [{:#6.0g}]" ), 1.234e-37 ) == STR (" [1.e-37]" ));
838
839
839
840
// Precision
840
841
Float value = 1234.52734375 ;
You can’t perform that action at this time.
0 commit comments