format money correctly

allow_new_sellers
Martin Brodbeck 4 years ago
parent fa7938ca20
commit 669a708bce
  1. 8
      src/core/marketplace.cpp

@ -114,8 +114,12 @@ int Marketplace::getBasketSumInCent()
std::string Marketplace::getBasketSumAsString()
{
int sumInCent = getBasketSumInCent();
double sumInEuro = sumInCent / 100.0L;
// double sumInEuro = sumInCent / 100.0L;
// std::stringstream sumStream;
// sumStream << std::fixed << std::setprecision(2) << sumInEuro << " €";
// return sumStream.str();
std::stringstream sumStream;
sumStream << std::fixed << std::setprecision(2) << sumInEuro << "";
sumStream.imbue(std::locale("de_DE.utf8"));
sumStream << std::right << std::setw(12) << std::showbase << std::put_money(sumInCent, false);
return sumStream.str();
}
Loading…
Cancel
Save