*** no comment ***
This commit is contained in:
parent
fd3ae9b4dd
commit
022594bb2f
1 changed files with 10 additions and 6 deletions
16
amount.cc
16
amount.cc
|
|
@ -818,8 +818,6 @@ std::ostream& operator<<(std::ostream& _out, const amount_t& amt)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (precision) {
|
if (precision) {
|
||||||
out << ((comm.flags & COMMODITY_STYLE_EUROPEAN) ? ',' : '.');
|
|
||||||
|
|
||||||
std::ostringstream final;
|
std::ostringstream final;
|
||||||
final.width(precision);
|
final.width(precision);
|
||||||
final.fill('0');
|
final.fill('0');
|
||||||
|
|
@ -834,12 +832,18 @@ std::ostream& operator<<(std::ostream& _out, const amount_t& amt)
|
||||||
if (q[i - 1] != '0')
|
if (q[i - 1] != '0')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
std::string ender;
|
||||||
if (i == len)
|
if (i == len)
|
||||||
out << str;
|
ender = str;
|
||||||
else if (i < comm.precision)
|
else if (i < comm.precision())
|
||||||
out << std::string(str, 0, comm.precision);
|
ender = std::string(str, 0, comm.precision());
|
||||||
else
|
else
|
||||||
out << std::string(str, 0, i);
|
ender = std::string(str, 0, i);
|
||||||
|
|
||||||
|
if (! ender.empty()) {
|
||||||
|
out << ((comm.flags() & COMMODITY_STYLE_EUROPEAN) ? ',' : '.');
|
||||||
|
out << ender;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comm.flags & COMMODITY_STYLE_SUFFIXED) {
|
if (comm.flags & COMMODITY_STYLE_SUFFIXED) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue