예제 #1
0
파일: Int16.cs 프로젝트: xwyangjshb/mono
 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));
 }
예제 #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));
        }
예제 #3
0
 public bool TryFormat(Span <char> destination, out int charsWritten, ReadOnlySpan <char> format = default, IFormatProvider provider = null)
 {
     return(Number.TryFormatUInt32(m_value, format, provider, destination, out charsWritten));
 }
예제 #4
0
 public bool TryFormat(Span <char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan <char> format = default, IFormatProvider?provider = null)
 {
     return(Number.TryFormatUInt32(m_value, format, provider, destination, out charsWritten));
 }
예제 #5
0
 public bool TryFormat(Span <char> destination, out int charsWritten, string format = null, IFormatProvider provider = null)
 {
     return(Number.TryFormatUInt32(m_value, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten));
 }