fix width

This commit is contained in:
Martin Brodbeck 2018-08-08 09:25:37 +02:00
parent f260bc2b0c
commit 6b0f31a0c2
1 changed files with 2 additions and 2 deletions

View File

@ -13,9 +13,9 @@ std::string formatCentAsEuroString(const int cent, int width)
currStream << std::right << std::setw(width) << std::showbase
<< std::put_money(cent, false);
} catch (std::runtime_error& err) {
currStream << std::fixed << std::setw(width - 2) << std::setprecision(2) << cent / 100.0L
currStream << std::fixed << std::setw(width >= 4 ? width - 4 : width) << std::setprecision(2) << cent / 100.0L
<< "";
}
return currStream.str();
}
}