internal string ConvertToLocalizedText(decimal num) { StringBuilder text = new StringBuilder(); StackWithIndex stack = new StackWithIndex(); if (num < 0M) { text.Append(this.Minus); num = Math.Abs(num); } num = this.Initialize(num); if (((ulong)num) == 0L) { text.Append(this.Zero); } else { this.GetIntegralStack(Math.Truncate(num), 1L, stack); this.ConvertIntergralStackToText(stack, text); } num -= Math.Truncate(num); if (num != 0M) { text.Append(this.DecimalPoint); this.GetDecimalText(num, text); } return(text.ToString()); }
internal string ConvertToLocalizedText(decimal num) { StringBuilder text = new StringBuilder(); StackWithIndex stack = new StackWithIndex(); if (num < 0M) { text.Append(this.Minus); num = Math.Abs(num); } num = this.Initialize(num); if (((ulong)num) == 0L) { text.Append(this.Zero); } else { this.GetIntegralStack(Math.Truncate(num), 1L, stack); this.ConvertIntergralStackToText(stack, text); } num -= Math.Truncate(num); if (num != 0M) { text.Append(this.DecimalPoint); this.GetDecimalText(num, text); } return text.ToString(); }
protected virtual void GetIntegralStack(decimal num, ulong position, StackWithIndex stack) { if (num < 10000M) { if ((num != 0M) || (position == 0xe8d4a51000L)) { stack.Push(this.GetPositionText(position)); } for (int i = 0; i < 4; i++) { int digit = (int)(num % 10M); ulong num4 = (ulong)Math.Pow(10.0, (double)i); num /= 10M; stack.Push(this.GetDigitText(digit, num4)); } } else { this.GetIntegralStack(Math.Truncate((decimal)(num % 10000M)), position, stack); this.GetIntegralStack(Math.Truncate((decimal)(num / 10000M)), position * ((ulong)0x2710L), stack); } }
protected abstract void ConvertIntergralStackToText(StackWithIndex stack, StringBuilder text);