Skip to content

Commit

Permalink
Merge pull request #14 from bean-mhm/dev
Browse files Browse the repository at this point in the history
fixed bug where using ',' for decimal point and/or '.' for thousands …
  • Loading branch information
bean-mhm authored Jan 3, 2025
2 parents 37c0143 + 29965b0 commit 22040ae
Show file tree
Hide file tree
Showing 3 changed files with 371 additions and 4 deletions.
4 changes: 2 additions & 2 deletions RealBloom/src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ std::string Config::CFG_FILENAME = getLocalPath("config.xml");
// Const

const char* Config::APP_TITLE = "RealBloom";
const char* Config::APP_VERSION = "0.7.0-beta";
const char* Config::APP_VERSION = "0.7.1-beta";
const char* Config::APP_LOCALE = "en_US.UTF-8";

const uint32_t Config::WINDOW_WIDTH = 1440;
Expand All @@ -14,7 +14,7 @@ const float Config::UI_MAX_SCALE = 1.50f;
const float Config::UI_MIN_SCALE = 0.75f;

const char* Config::GITHUB_URL = "https://github.com/bean-mhm/realbloom";
const char* Config::DOCS_URL = "https://github.com/bean-mhm/realbloom/blob/main/docs/v0.7.0-beta/tutorial.md";
const char* Config::DOCS_URL = "https://github.com/bean-mhm/realbloom/blob/main/docs/v0.7.1-beta/tutorial.md";

// Variable
float Config::UI_SCALE = 1.0f;
Expand Down
35 changes: 33 additions & 2 deletions RealBloom/src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,43 @@ static constexpr float EXPOSURE_RANGE = 10.0f;
// Dialog Params
DialogParams_MoveTo dialogParams_MoveTo;

class NumPunctFacet : public std::numpunct<char>
{
protected:
char do_decimal_point() const override
{
return '.';
}

char do_thousands_sep() const override
{
return ',';
}

std::string do_grouping() const override
{
return "\3";
}

std::string do_truename() const override
{
return "true";
}

std::string do_falsename() const override
{
return "false";
}

};

int main(int argc, char** argv)
{
// Set Locale
if (!std::setlocale(LC_ALL, Config::APP_LOCALE))
std::cout << "Couldn't set locale to \"" << Config::APP_LOCALE << "\".\n";
std::locale::global(std::locale(
std::locale(Config::APP_LOCALE),
new NumPunctFacet
));

// Load config
Config::load();
Expand Down
Loading

0 comments on commit 22040ae

Please sign in to comment.