Пример #1
0
 public static bool TryParse(ReadOnlySpan <char> s, NumberStyles style, IFormatProvider?provider, out ulong result)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.TryParseUInt64(s, style, NumberFormatInfo.GetInstance(provider), out result) == Number.ParsingStatus.OK);
 }
Пример #2
0
 public static Decimal Parse(String s, IFormatProvider provider)
 {
     return(Number.ParseDecimal(s, NumberStyles.Number, NumberFormatInfo.GetInstance(provider)));
 }
Пример #3
0
        public string ToString(string format, IFormatProvider fp)
        {
            NumberFormatInfo nfi = NumberFormatInfo.GetInstance(fp);

            return(NumberFormatter.NumberToString(format, this, nfi));
        }
Пример #4
0
 public static Boolean TryParse(String s, NumberStyles style, IFormatProvider provider, out UInt64 result)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.TryParseUInt64(s, style, NumberFormatInfo.GetInstance(provider), out result));
 }
Пример #5
0
 public static bool TryParse(ReadOnlySpan <char> s, NumberStyles style, IFormatProvider provider, out byte result)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(TryParse(s, style, NumberFormatInfo.GetInstance(provider), out result));
 }
Пример #6
0
 public static bool TryParse(string s, NumberStyles style, IFormatProvider provider, out float result)
 {
     NumberFormatInfo2.ValidateParseStyleFloatingPoint(style);
     return(TryParse(s, style, NumberFormatInfo.GetInstance(provider), out result));
 }
Пример #7
0
 public static ulong Parse(string s, IFormatProvider provider)
 {
     return(Number.ParseUInt64(s, NumberStyles.Integer, NumberFormatInfo.GetInstance(provider)));
 }
Пример #8
0
 public bool TryFormat(Span <char> destination, out int charsWritten, ReadOnlySpan <char> format = default, IFormatProvider?provider = null)
 {
     return(Number.TryFormatDouble(m_value, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten));
 }
Пример #9
0
 public static double Parse(string s, IFormatProvider?provider)
 {
     if (s == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
     }
     return(Number.ParseDouble(s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.GetInstance(provider)));
 }
Пример #10
0
 public static QualityValue Parse(string s, NumberStyles style, IFormatProvider provider)
 {
     // NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
     return(Parse(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Пример #11
0
 public string ToString(string?format, IFormatProvider?provider)
 {
     return(Number.FormatDouble(m_value, format, NumberFormatInfo.GetInstance(provider)));
 }
Пример #12
0
 public static QualityValue Parse(string s, IFormatProvider provider)
 {
     return(Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.GetInstance(provider)));
 }
Пример #13
0
 public static Boolean TryParse(String s, NumberStyles style, IFormatProvider provider, out Decimal result)
 {
     ValidateParseStyleFloatingPoint(style);
     return(Number.TryParseDecimal(s, style, NumberFormatInfo.GetInstance(provider), out result));
 }
Пример #14
0
 public static Decimal Parse(String s, NumberStyles style, IFormatProvider provider)
 {
     ValidateParseStyleFloatingPoint(style);
     return(Number.ParseDecimal(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Пример #15
0
 public static float Parse(string s, IFormatProvider provider)
 {
     return(Number.ParseSingle(s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.GetInstance(provider)));
 }
Пример #16
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.Float | NumberStyles.AllowThousands, IFormatProvider?provider = null)
        {
            NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
            return(Number.ParseDouble(s, style, NumberFormatInfo.GetInstance(provider)));
        }
Пример #17
0
 public static float Parse(string s, NumberStyles style, IFormatProvider provider)
 {
     NumberFormatInfo2.ValidateParseStyleFloatingPoint(style);
     return(Number.ParseSingle(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Пример #18
0
 public static bool TryParse(ReadOnlySpan <char> s, NumberStyles style, IFormatProvider?provider, out double result)
 {
     NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
     return(TryParse(s, style, NumberFormatInfo.GetInstance(provider), out result));
 }
Пример #19
0
 public String ToString(String format, IFormatProvider provider)
 {
     Contract.Ensures(Contract.Result <String>() != null);
     return(Number.FormatUInt64(m_value, format, NumberFormatInfo.GetInstance(provider)));
 }
Пример #20
0
 public string ToString(string format, IFormatProvider provider) => Number.Format(this.m_value, true, format, NumberFormatInfo.GetInstance(provider));
Пример #21
0
 public static ulong Parse(String s, NumberStyles style, IFormatProvider provider)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.ParseUInt64(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Пример #22
0
 public string ToString(IFormatProvider provider)
 {
     return(this.ToString((string)null, (IFormatProvider)NumberFormatInfo.GetInstance(provider)));
 }
Пример #23
0
 public static byte Parse(ReadOnlySpan <char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Parse(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Пример #24
0
 public String ToString(String format, IFormatProvider provider)
 {
     return(Number.FormatDecimal(ToDecimal(this), format, NumberFormatInfo.GetInstance(provider)));
 }
Пример #25
0
 public String ToString(String format, IFormatProvider provider)
 {
     return(Number.FormatInt32(m_value, format, NumberFormatInfo.GetInstance(provider)));
 }
Пример #26
0
 public String ToString(IFormatProvider provider)
 {
     Contract.Ensures(Contract.Result <String>() != null);
     return(Number.FormatDecimal(this, null, NumberFormatInfo.GetInstance(provider)));
 }