File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 55using System ;
66using System . Collections . Generic ;
77using System . Collections . Immutable ;
8+ using System . Globalization ;
89using System . Linq ;
910using System . Reflection ;
1011using System . Text ;
@@ -2238,8 +2239,9 @@ public override void VisitLiteralExpression(LiteralExpressionSyntax node)
22382239 case SyntaxKind . NumericLiteralToken :
22392240 {
22402241 string _value = asToken . Text ;
2241-
2242+
22422243 _value = _value . Replace ( "_" , "" ) ;
2244+ _value = _value . Replace ( ',' , '.' ) ;
22432245
22442246 if ( _value . EndsWith ( 'f' ) ||
22452247 _value . EndsWith ( 'd' ) ||
@@ -2252,15 +2254,11 @@ public override void VisitLiteralExpression(LiteralExpressionSyntax node)
22522254 _value . EndsWith ( 'U' ) ||
22532255 _value . EndsWith ( 'L' ) )
22542256 _value = _value . Remove ( _value . Length - 1 ) ;
2255-
2257+
22562258 if ( _value . Length > 10 )
22572259 {
2258- double _d = 0 ;
2259-
2260- if ( _value . Contains ( "E" ) )
2261- _d = double . Parse ( _value . Replace ( '.' , ',' ) , System . Globalization . NumberStyles . Float ) ;
2262- else
2263- _d = Convert . ToDouble ( _value . Replace ( '.' , ',' ) ) ;
2260+ NumberStyles _styles = NumberStyles . AllowTrailingSign | NumberStyles . AllowDecimalPoint | NumberStyles . AllowThousands | NumberStyles . AllowExponent | NumberStyles . AllowCurrencySymbol ;
2261+ double _d = double . Parse ( _value . Replace ( '.' , ',' ) , _styles ) ;
22642262
22652263 if ( _value . StartsWith ( '-' ) )
22662264 {
You can’t perform that action at this time.
0 commit comments