summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2018-04-13 19:07:34 -0400
committerJan Kotas <jkotas@microsoft.com>2018-04-13 16:07:34 -0700
commit3db838482038472ee9d75e3a204a77542d30b82b (patch)
tree1a1b7e3b1c3e319d1f6cab4fba2d6b55869d086e /src
parent5b1c670f3a48dadedac439bd13d0e35064174c14 (diff)
downloadcoreclr-3db838482038472ee9d75e3a204a77542d30b82b.tar.gz
coreclr-3db838482038472ee9d75e3a204a77542d30b82b.tar.bz2
coreclr-3db838482038472ee9d75e3a204a77542d30b82b.zip
Fix default style argument to Double/Single/Decimal.Parse (#17556)
Diffstat (limited to 'src')
-rw-r--r--src/mscorlib/shared/System/Double.cs2
-rw-r--r--src/mscorlib/shared/System/Single.cs2
-rw-r--r--src/mscorlib/src/System/Decimal.cs2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/mscorlib/shared/System/Double.cs b/src/mscorlib/shared/System/Double.cs
index 8eae31232f..e466935953 100644
--- a/src/mscorlib/shared/System/Double.cs
+++ b/src/mscorlib/shared/System/Double.cs
@@ -297,7 +297,7 @@ namespace System
// PositiveInfinity or NegativeInfinity for a number that is too
// large or too small.
- public static double Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null)
+ public static double Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Float | NumberStyles.AllowThousands, IFormatProvider provider = null)
{
NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
return Number.ParseDouble(s, style, NumberFormatInfo.GetInstance(provider));
diff --git a/src/mscorlib/shared/System/Single.cs b/src/mscorlib/shared/System/Single.cs
index cb5a309871..a74d3770fa 100644
--- a/src/mscorlib/shared/System/Single.cs
+++ b/src/mscorlib/shared/System/Single.cs
@@ -288,7 +288,7 @@ namespace System
return Number.ParseSingle(s, style, NumberFormatInfo.GetInstance(provider));
}
- public static float Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null)
+ public static float Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Float | NumberStyles.AllowThousands, IFormatProvider provider = null)
{
NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
return Number.ParseSingle(s, style, NumberFormatInfo.GetInstance(provider));
diff --git a/src/mscorlib/src/System/Decimal.cs b/src/mscorlib/src/System/Decimal.cs
index b66519c8d3..baab51c0dc 100644
--- a/src/mscorlib/src/System/Decimal.cs
+++ b/src/mscorlib/src/System/Decimal.cs
@@ -539,7 +539,7 @@ namespace System
return Number.ParseDecimal(s, style, NumberFormatInfo.GetInstance(provider));
}
- public static decimal Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null)
+ public static decimal Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Number, IFormatProvider provider = null)
{
NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
return Number.ParseDecimal(s, style, NumberFormatInfo.GetInstance(provider));