Format octal 0 as 0
This commit is contained in:
@@ -1441,7 +1441,7 @@ template <typename Range> class basic_writer {
|
||||
|
||||
void on_oct() {
|
||||
int num_digits = internal::count_digits<3>(abs_value);
|
||||
if (specs.alt && specs.precision <= num_digits) {
|
||||
if (specs.alt && specs.precision <= num_digits && abs_value != 0) {
|
||||
// Octal prefix '0' is counted as a digit, so only add it if precision
|
||||
// is not greater than the number of digits.
|
||||
prefix[prefix_size++] = '0';
|
||||
|
||||
Reference in New Issue
Block a user