set locale in main()
This commit is contained in:
parent
669a708bce
commit
1ce329b99b
3 changed files with 7 additions and 2 deletions
|
@ -30,7 +30,7 @@ int Article::getPrice() const { return price_; }
|
||||||
std::string Article::getPriceAsString() const
|
std::string Article::getPriceAsString() const
|
||||||
{
|
{
|
||||||
std::stringstream sumStream;
|
std::stringstream sumStream;
|
||||||
sumStream.imbue(std::locale("de_DE.utf8"));
|
//sumStream.imbue(std::locale("de_DE.utf8"));
|
||||||
sumStream << std::right << std::setw(12) << std::showbase << std::put_money(price_, false);
|
sumStream << std::right << std::setw(12) << std::showbase << std::put_money(price_, false);
|
||||||
return sumStream.str();
|
return sumStream.str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ std::string Marketplace::getBasketSumAsString()
|
||||||
// sumStream << std::fixed << std::setprecision(2) << sumInEuro << " €";
|
// sumStream << std::fixed << std::setprecision(2) << sumInEuro << " €";
|
||||||
// return sumStream.str();
|
// return sumStream.str();
|
||||||
std::stringstream sumStream;
|
std::stringstream sumStream;
|
||||||
sumStream.imbue(std::locale("de_DE.utf8"));
|
//sumStream.imbue(std::locale("de_DE.utf8"));
|
||||||
sumStream << std::right << std::setw(12) << std::showbase << std::put_money(sumInCent, false);
|
sumStream << std::right << std::setw(12) << std::showbase << std::put_money(sumInCent, false);
|
||||||
return sumStream.str();
|
return sumStream.str();
|
||||||
}
|
}
|
|
@ -6,6 +6,11 @@ int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
// Q_INIT_RESOURCE(application);
|
// Q_INIT_RESOURCE(application);
|
||||||
|
|
||||||
|
// Set the locale to german, so that currency is correct
|
||||||
|
//std::locale german("de_DE.utf-8");
|
||||||
|
std::locale myLocale("");
|
||||||
|
std::locale::global(myLocale);
|
||||||
|
|
||||||
QApplication kimaApp{argc, argv};
|
QApplication kimaApp{argc, argv};
|
||||||
|
|
||||||
QCoreApplication::setOrganizationName("RustySoft");
|
QCoreApplication::setOrganizationName("RustySoft");
|
||||||
|
|
Loading…
Reference in a new issue