format money even when locale is not supported
This commit is contained in:
parent
da4e223b16
commit
36643cf737
6 changed files with 44 additions and 43 deletions
|
@ -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_; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue