Ejemplo n.º 1
0
 public bool TryFormat(Span <char> destination, out int charsWritten, ReadOnlySpan <char> format = default, IFormatProvider provider = null)
 {
     if (m_value < 0 && format.Length > 0 && (format[0] == 'X' || format[0] == 'x'))
     {
         uint temp = (uint)(m_value & 0x0000FFFF);
         return(Number.TryFormatUInt32(temp, format, provider, destination, out charsWritten));
     }
     return(Number.TryFormatInt32(m_value, format, provider, destination, out charsWritten));
 }
Ejemplo n.º 2
0
        public bool TryFormat(Span <char> destination, out int charsWritten, string format = null, IFormatProvider provider = null)
        {
            NumberFormatInfo info = NumberFormatInfo.GetInstance(provider);

            if (m_value < 0 && format != null && format.Length > 0 && (format[0] == 'X' || format[0] == 'x'))
            {
                uint temp = (uint)(m_value & 0x0000FFFF);
                return(Number.TryFormatUInt32(temp, format, info, destination, out charsWritten));
            }
            return(Number.TryFormatInt32(m_value, format, info, destination, out charsWritten));
        }
Ejemplo n.º 3
0
 public bool TryFormat(Span <char> destination, out int charsWritten, ReadOnlySpan <char> format = default, IFormatProvider?provider = null)
 {
     return(Number.TryFormatInt32(m_value, 0x000000FF, format, provider, destination, out charsWritten));
 }
Ejemplo n.º 4
0
 public bool TryFormat(Span <char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan <char> format = default, IFormatProvider?provider = null)
 {
     return(Number.TryFormatInt32(m_value, 0x000000FF, format, provider, destination, out charsWritten));
 }
Ejemplo n.º 5
0
Archivo: Int32.cs Proyecto: tmds/corert
 public bool TryFormat(Span <char> destination, out int charsWritten, ReadOnlySpan <char> format = default, IFormatProvider provider = null)
 {
     return(Number.TryFormatInt32(m_value, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten));
 }