Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FormatNumber()

static void System.Number.FormatNumber ( ref ValueStringBuilder sb,
ref NumberBuffer number,
int nMaxDigits,
NumberFormatInfo info )
inlinestaticprivate

Definition at line 3261 of file Number.cs.

3262 {
3263 string text = (number.IsNegative ? s_negNumberFormats[info.NumberNegativePattern] : "#");
3264 string text2 = text;
3265 foreach (char c in text2)
3266 {
3267 switch (c)
3268 {
3269 case '#':
3270 FormatFixed(ref sb, ref number, nMaxDigits, info._numberGroupSizes, info.NumberDecimalSeparator, info.NumberGroupSeparator);
3271 break;
3272 case '-':
3273 sb.Append(info.NegativeSign);
3274 break;
3275 default:
3276 sb.Append(c);
3277 break;
3278 }
3279 }
3280 }
static unsafe void FormatFixed(ref ValueStringBuilder sb, ref NumberBuffer number, int nMaxDigits, int[] groupDigits, string sDecimal, string sGroup)
Definition Number.cs:3170
static readonly string[] s_negNumberFormats
Definition Number.cs:1251

References System.Number.FormatFixed(), System.info, System.Number.s_negNumberFormats, and System.text.

Referenced by System.Number.NumberToString().