format money even when locale is not supported

This commit is contained in:
Martin Brodbeck 2018-08-02 13:06:37 +02:00
parent da4e223b16
commit 36643cf737
6 changed files with 44 additions and 43 deletions

View file

@ -1,4 +1,5 @@
#include "article.h"
#include "utils.h"
#include <iomanip>
#include <sstream>
@ -30,10 +31,7 @@ int Article::getPrice() const { return price_; }
std::string Article::getPriceAsString() const
{
std::stringstream sumStream;
// sumStream.imbue(std::locale("de_DE.utf8"));
sumStream << std::right << std::setw(10) << std::showbase << std::put_money(price_, false);
return sumStream.str();
return formatCentAsEuroString(price_);
}
int Article::getArticleNo() const { return articleNo_; }