Accept thousands separators in inferred values.
This commit is contained in:
parent
58ce0bb804
commit
8db015bc0f
|
@ -1100,7 +1100,7 @@ bool SIM_MODEL::InferSimModel( T_symbol& aSymbol, std::vector<T_field>* aFields,
|
||||||
if( aModelParams->IsEmpty() )
|
if( aModelParams->IsEmpty() )
|
||||||
{
|
{
|
||||||
wxRegEx idealVal( wxT( "^"
|
wxRegEx idealVal( wxT( "^"
|
||||||
"([0-9\\. ]+)"
|
"([0-9\\,\\. ]+)"
|
||||||
"([fFpPnNuUmMkKgGtTμµ𝛍𝜇𝝁 ]|M(e|E)(g|G))?"
|
"([fFpPnNuUmMkKgGtTμµ𝛍𝜇𝝁 ]|M(e|E)(g|G))?"
|
||||||
"([fFhHΩΩ𝛀𝛺𝝮rR]|ohm)?"
|
"([fFhHΩΩ𝛀𝛺𝝮rR]|ohm)?"
|
||||||
"([-1-9 ]*)"
|
"([-1-9 ]*)"
|
||||||
|
@ -1113,6 +1113,9 @@ bool SIM_MODEL::InferSimModel( T_symbol& aSymbol, std::vector<T_field>* aFields,
|
||||||
wxString valueExponent( idealVal.GetMatch( value, 2 ) );
|
wxString valueExponent( idealVal.GetMatch( value, 2 ) );
|
||||||
wxString valueFraction( idealVal.GetMatch( value, 6 ) );
|
wxString valueFraction( idealVal.GetMatch( value, 6 ) );
|
||||||
|
|
||||||
|
// Remove any thousands separators
|
||||||
|
valueMantissa.Replace( wxT( "," ), wxEmptyString );
|
||||||
|
|
||||||
if( valueMantissa.Contains( wxT( "." ) ) || valueFraction.IsEmpty() )
|
if( valueMantissa.Contains( wxT( "." ) ) || valueFraction.IsEmpty() )
|
||||||
{
|
{
|
||||||
aModelParams->Printf( wxT( "%s=\"%s%s\"" ),
|
aModelParams->Printf( wxT( "%s=\"%s%s\"" ),
|
||||||
|
@ -1175,6 +1178,9 @@ bool SIM_MODEL::InferSimModel( T_symbol& aSymbol, std::vector<T_field>* aFields,
|
||||||
wxString valueExponent( sourceVal.GetMatch( value, 2 ) );
|
wxString valueExponent( sourceVal.GetMatch( value, 2 ) );
|
||||||
wxString valueFraction( sourceVal.GetMatch( value, 6 ) );
|
wxString valueFraction( sourceVal.GetMatch( value, 6 ) );
|
||||||
|
|
||||||
|
// Remove any thousands separators
|
||||||
|
valueMantissa.Replace( wxT( "," ), wxEmptyString );
|
||||||
|
|
||||||
if( valueMantissa.Contains( wxT( "." ) ) || valueFraction.IsEmpty() )
|
if( valueMantissa.Contains( wxT( "." ) ) || valueFraction.IsEmpty() )
|
||||||
{
|
{
|
||||||
aModelParams->Printf( wxT( "dc=\"%s%s\"" ),
|
aModelParams->Printf( wxT( "dc=\"%s%s\"" ),
|
||||||
|
|
Loading…
Reference in New Issue