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

◆ FormatCurrency()

static void System.Globalization.FormatProvider.Number.FormatCurrency ( ref System::Text::ValueStringBuilder sb,
ref NumberBuffer number,
int nMinDigits,
int nMaxDigits,
NumberFormatInfo info )
inlinestaticprivate

Definition at line 543 of file FormatProvider.cs.

544 {
545 string text = (number.sign ? s_negCurrencyFormats[info.CurrencyNegativePattern] : s_posCurrencyFormats[info.CurrencyPositivePattern]);
546 string text2 = text;
547 foreach (char c in text2)
548 {
549 switch (c)
550 {
551 case '#':
552 FormatFixed(ref sb, ref number, nMinDigits, nMaxDigits, info, info.CurrencyGroupSizes, info.CurrencyDecimalSeparator, info.CurrencyGroupSeparator);
553 break;
554 case '-':
555 sb.Append(info.NegativeSign);
556 break;
557 case '$':
558 sb.Append(info.CurrencySymbol);
559 break;
560 default:
561 sb.Append(c);
562 break;
563 }
564 }
565 }
static unsafe void FormatFixed(ref System.Text.ValueStringBuilder sb, ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info, int[] groupDigits, string sDecimal, string sGroup)
static readonly string[] s_negCurrencyFormats
static readonly string[] s_posCurrencyFormats

References System.Globalization.FormatProvider.Number.FormatFixed(), System.info, System.Globalization.FormatProvider.Number.s_negCurrencyFormats, System.Globalization.FormatProvider.Number.s_posCurrencyFormats, and System.text.

Referenced by System.Globalization.FormatProvider.Number.NumberToString().