Skip to content

Commit a250b0a

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 7b89562 + 4e85393 commit a250b0a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/decimal.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,8 +1710,8 @@ decimal<Prec, RoundPolicy> decimal_cast(const char (&arg)[N]) {
17101710
output << "-";
17111711
}
17121712

1713+
std::locale oldloc = output.getloc();
17131714
if (format.thousands_grouping() && format.change_thousands_if_needed()) {
1714-
std::locale oldloc = output.getloc();
17151715
output.imbue( std::locale( std::locale::classic(), new decimal_format_punct(format) ) );
17161716
output << before;
17171717
output.imbue(oldloc);
@@ -1720,9 +1720,11 @@ decimal<Prec, RoundPolicy> decimal_cast(const char (&arg)[N]) {
17201720
}
17211721

17221722
if (arg.getDecimalPoints() > 0) {
1723+
output.imbue(std::locale::classic());
17231724
output << format.decimal_point();
17241725
output << setw(arg.getDecimalPoints()) << setfill('0') << right
17251726
<< after;
1727+
output.imbue(oldloc);
17261728
}
17271729
}
17281730

0 commit comments

Comments
 (0)