Skip to content

Commit a57468d

Browse files
committed
Use formatting limits instead of arbitrary size
1 parent d8a015e commit a57468d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/charconv_cohort_preservation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ int main()
8787
}
8888

8989
// The same chars_format option applies to to_chars which allows us to roundtrip the values
90-
char buffer[64] {};
90+
char buffer[boost::decimal::formatting_limits<decimal32_t>::cohort_preserving_scientific_max_chars] {};
9191
const auto r_to = to_chars(buffer, buffer + sizeof(buffer), string_val, chars_format::cohort_preserving_scientific);
9292

9393
if (!r_to)

0 commit comments

Comments
 (0)