private static unsafe void DecimalToNumber(ref decimal d, ref NumberBuffer number)
{
- char* buffer = number.digits;
+ char* buffer = number.GetDigitsPointer();
number.precision = DecimalPrecision;
number.sign = d.IsNegative;
number.kind = NumberBufferKind.Decimal;
int i = (int)((byte*)(buffer + DecimalPrecision) - (byte*)p) >> 1;
number.scale = i - d.Scale;
- char* dst = number.digits;
+ char* dst = number.GetDigitsPointer();
while (--i >= 0)
{
*dst++ = *p++;
value = -value;
}
- char* buffer = number.digits;
+ char* buffer = number.GetDigitsPointer();
char* p = UInt32ToDecChars(buffer + Int32Precision, (uint)value, 0);
int i = (int)(buffer + Int32Precision - p);
number.scale = i;
number.kind = NumberBufferKind.Integer;
- char* dst = number.digits;
+ char* dst = number.GetDigitsPointer();
while (--i >= 0)
*dst++ = *p++;
*dst = '\0';
number.precision = UInt32Precision;
number.sign = false;
- char* buffer = number.digits;
+ char* buffer = number.GetDigitsPointer();
char* p = UInt32ToDecChars(buffer + UInt32Precision, value, 0);
int i = (int)(buffer + UInt32Precision - p);
number.scale = i;
number.kind = NumberBufferKind.Integer;
- char* dst = number.digits;
+ char* dst = number.GetDigitsPointer();
while (--i >= 0)
*dst++ = *p++;
*dst = '\0';
value = (ulong)(-input);
}
- char* buffer = number.digits;
+ char* buffer = number.GetDigitsPointer();
char* p = buffer + Int64Precision;
while (High32(value) != 0)
p = UInt32ToDecChars(p, Int64DivMod1E9(ref value), 9);
number.scale = i;
number.kind = NumberBufferKind.Integer;
- char* dst = number.digits;
+ char* dst = number.GetDigitsPointer();
while (--i >= 0)
*dst++ = *p++;
*dst = '\0';
number.precision = UInt64Precision;
number.sign = false;
- char* buffer = number.digits;
+ char* buffer = number.GetDigitsPointer();
char* p = buffer + UInt64Precision;
while (High32(value) != 0)
number.scale = i;
number.kind = NumberBufferKind.Integer;
- char* dst = number.digits;
+ char* dst = number.GetDigitsPointer();
while (--i >= 0)
*dst++ = *p++;
*dst = '\0';
int section;
int src;
- char* dig = number.digits;
+ char* dig = number.GetDigitsPointer();
char ch;
section = FindSection(format, dig[0] == 0 ? 2 : number.sign ? 1 : 0);
private static unsafe void FormatFixed(ref ValueStringBuilder sb, ref NumberBuffer number, int nMaxDigits, NumberFormatInfo info, int[] groupDigits, string sDecimal, string sGroup)
{
int digPos = number.scale;
- char* dig = number.digits;
+ char* dig = number.GetDigitsPointer();
if (digPos > 0)
{
private static unsafe void FormatScientific(ref ValueStringBuilder sb, ref NumberBuffer number, int nMaxDigits, NumberFormatInfo info, char expChar)
{
- char* dig = number.digits;
+ char* dig = number.GetDigitsPointer();
sb.Append((*dig != 0) ? *dig++ : '0');
}
}
- char* dig = number.digits;
+ char* dig = number.GetDigitsPointer();
if (digPos > 0)
{
private static unsafe void RoundNumber(ref NumberBuffer number, int pos)
{
- char* dig = number.digits;
+ char* dig = number.GetDigitsPointer();
int i = 0;
while (i < pos && dig[i] != 0)