File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,24 @@ constexpr auto parse_impl(ParseContext &ctx)
124124 case ' x' :
125125 fmt = chars_format::hex;
126126 break ;
127+
128+ case ' A' :
129+ if (ctx_precision != -1 )
130+ {
131+ BOOST_DECIMAL_THROW_EXCEPTION (std::logic_error (" Cohort preservation is mutually exclusive with precision" ));
132+ }
133+
134+ is_upper = true ;
135+ fmt = chars_format::cohort_preserving_scientific;
136+ break ;
137+ case ' a' :
138+ if (ctx_precision != -1 )
139+ {
140+ BOOST_DECIMAL_THROW_EXCEPTION (std::logic_error (" Cohort preservation is mutually exclusive with precision" ));
141+ }
142+
143+ fmt = chars_format::cohort_preserving_scientific;
144+ break ;
127145 // LCOV_EXCL_START
128146 default :
129147 BOOST_DECIMAL_THROW_EXCEPTION (std::logic_error (" Invalid format specifier" ));
Original file line number Diff line number Diff line change 2525// Fixed :f
2626// Scientific :e
2727// Hex :x
28+ // Cohort Preserving :a
2829//
2930// Capital letter for any of the above leads to all characters being uppercase
3031
@@ -120,6 +121,19 @@ constexpr auto parse_impl(ParseContext &ctx)
120121 case ' x' :
121122 fmt = chars_format::hex;
122123 break ;
124+
125+ case ' A' :
126+ is_upper = true ;
127+ [[fallthrough]];
128+ case ' a' :
129+ if (ctx_precision != -1 )
130+ {
131+ BOOST_DECIMAL_THROW_EXCEPTION (std::format_error (" Cohort preservation is mutually exclusive with precision" ));
132+ }
133+
134+ fmt = chars_format::cohort_preserving_scientific;
135+ break ;
136+
123137 // LCOV_EXCL_START
124138 default :
125139 BOOST_DECIMAL_THROW_EXCEPTION (std::format_error (" Invalid format specifier" ));
You can’t perform that action at this time.
0 commit comments