Exemple #1
0
 public static float Parse(String s, NumberStyles style)
 {
     NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
     return(Parse(s, style, NumberFormatInfo.CurrentInfo));
 }
Exemple #2
0
 public static double Parse(String s, NumberStyles style, IFormatProvider provider)
 {
     NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
     return(Parse(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Exemple #3
0
 public static bool TryParse(String s, NumberStyles style, IFormatProvider provider, out double result)
 {
     NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
     return(TryParse(s, style, NumberFormatInfo.GetInstance(provider), out result));
 }
Exemple #4
0
 public static bool TryParse(ReadOnlySpan <char> s, NumberStyles style, IFormatProvider?provider, out float result)
 {
     NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
     return(TryParse(s, style, NumberFormatInfo.GetInstance(provider), out result));
 }
Exemple #5
0
 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)));
 }
Exemple #6
0
        // Parses a double from a String in the given style.  If
        // a NumberFormatInfo isn't specified, the current culture's
        // NumberFormatInfo is assumed.
        //
        // This method will not throw an OverflowException, but will return
        // 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)
        {
            NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
            return(Number.ParseDouble(s, style, NumberFormatInfo.GetInstance(provider)));
        }
Exemple #7
0
 public static Boolean TryParse(String s, NumberStyles style, IFormatProvider provider, out Decimal result)
 {
     NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
     return(Number.TryParseDecimal(s, style, NumberFormatInfo.GetInstance(provider), out result));
 }
Exemple #8
0
 public static Decimal Parse(String s, NumberStyles style)
 {
     NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
     return(Number.ParseDecimal(s, style, NumberFormatInfo.CurrentInfo));
 }