Attempt to fix locale issue with decimal separator in rules.

This commit is contained in:
Jeff Young 2020-08-15 17:30:55 +01:00
parent 6c74658a98
commit b42395ec8d
2 changed files with 9 additions and 9 deletions

View File

@ -372,10 +372,10 @@ int COMPILER::resolveUnits()
bool COMPILER::lexDefault( T_TOKEN& aToken )
{
T_TOKEN retval;
T_TOKEN retval;
wxString current;
int convertFrom;
wxString msg;
int convertFrom;
wxString msg;
retval.value.str = nullptr;
retval.token = G_ENDS;
@ -396,8 +396,8 @@ bool COMPILER::lexDefault( T_TOKEN& aToken )
auto extractNumber =
[&]()
{
bool haveSeparator = false;
wxUniChar ch = m_tokenizer.GetChar();
bool haveSeparator = false;
wxUniChar ch = m_tokenizer.GetChar();
do
{
@ -865,7 +865,7 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext )
}
else
{
value = wxAtof( *node->value.str );
value = DoubleValueFromString( EDA_UNITS::MILLIMETRES, *node->value.str );
}
node->SetUop( TR_UOP_PUSH_VALUE, value );

View File

@ -361,9 +361,9 @@ public:
switch( unitId )
{
case 0: return Mils2iu( v );
case 1: return Millimeter2iu( v );
case 2: return Mils2iu( v * 1000.0 );
case 0: return DoubleValueFromString( EDA_UNITS::INCHES, aString, true );
case 1: return DoubleValueFromString( EDA_UNITS::MILLIMETRES, aString );
case 2: return DoubleValueFromString( EDA_UNITS::INCHES, aString, false );
default: return v;
}
};