Skip to content

Commit

Permalink
Update locale string parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbeattie42 committed Oct 21, 2024
1 parent e35962a commit aee41de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions OpenSim/Common/IO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ int IO::_Pad = 8;
int IO::_Precision = 8;
char IO::_DoubleFormat[] = "%16.8lf";
bool IO::_PrintOfflineDocuments = true;
std::string IO::_locale = std::locale::classic().name();
std::locale _locale = std::locale::classic();


//=============================================================================
Expand Down Expand Up @@ -480,9 +480,9 @@ OpenOutputFile(const string &aFileName,ios_base::openmode mode)
double IO::
stod(const std::string& __str, std::size_t* __idx)
{
double result;
std::istringstream iss(__str);
iss.imbue(std::locale(_locale));
iss.imbue(_locale);
double result = 0.0;
iss >> result;
return result;
}
Expand Down
2 changes: 0 additions & 2 deletions OpenSim/Common/IO.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ class OSIMCOMMON_API IO {
static char _DoubleFormat[IO_DBLFMTLEN];
/** Whether offline documents should also be printed when Object::print is called. */
static bool _PrintOfflineDocuments;
/** Locale specifier for reading and writing files */
static std::string _locale;


//=============================================================================
Expand Down

0 comments on commit aee41de

Please sign in to comment.