Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 public static Decimal Parse(String s, IFormatProvider provider)
 {
     return(Number.ParseDecimal(s, NumberStyles.Number, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 3
0
        public string ToString(string format, IFormatProvider fp)
        {
            NumberFormatInfo nfi = NumberFormatInfo.GetInstance(fp);

            return(NumberFormatter.NumberToString(format, this, nfi));
        }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 7
0
 public static ulong Parse(string s, IFormatProvider provider)
 {
     return(Number.ParseUInt64(s, NumberStyles.Integer, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 10
0
 public static QualityValue Parse(string s, NumberStyles style, IFormatProvider provider)
 {
     // NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
     return(Parse(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 11
0
 public string ToString(string?format, IFormatProvider?provider)
 {
     return(Number.FormatDouble(m_value, format, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 12
0
 public static QualityValue Parse(string s, IFormatProvider provider)
 {
     return(Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 14
0
 public static Decimal Parse(String s, NumberStyles style, IFormatProvider provider)
 {
     ValidateParseStyleFloatingPoint(style);
     return(Number.ParseDecimal(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 15
0
 public static float Parse(string s, IFormatProvider provider)
 {
     return(Number.ParseSingle(s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 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)));
        }
Ejemplo n.º 17
0
 public static float Parse(string s, NumberStyles style, IFormatProvider provider)
 {
     NumberFormatInfo2.ValidateParseStyleFloatingPoint(style);
     return(Number.ParseSingle(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 19
0
 public String ToString(String format, IFormatProvider provider)
 {
     Contract.Ensures(Contract.Result <String>() != null);
     return(Number.FormatUInt64(m_value, format, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 20
0
 public string ToString(string format, IFormatProvider provider) => Number.Format(this.m_value, true, format, NumberFormatInfo.GetInstance(provider));
Ejemplo n.º 21
0
 public static ulong Parse(String s, NumberStyles style, IFormatProvider provider)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.ParseUInt64(s, style, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 22
0
 public string ToString(IFormatProvider provider)
 {
     return(this.ToString((string)null, (IFormatProvider)NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 24
0
 public String ToString(String format, IFormatProvider provider)
 {
     return(Number.FormatDecimal(ToDecimal(this), format, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 25
0
 public String ToString(String format, IFormatProvider provider)
 {
     return(Number.FormatInt32(m_value, format, NumberFormatInfo.GetInstance(provider)));
 }
Ejemplo n.º 26
0
 public String ToString(IFormatProvider provider)
 {
     Contract.Ensures(Contract.Result <String>() != null);
     return(Number.FormatDecimal(this, null, NumberFormatInfo.GetInstance(provider)));
 }