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

◆ FormatCurrency()

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

Definition at line 3146 of file Number.cs.

3147 {
3148 string text = (number.IsNegative ? s_negCurrencyFormats[info.CurrencyNegativePattern] : s_posCurrencyFormats[info.CurrencyPositivePattern]);
3149 string text2 = text;
3150 foreach (char c in text2)
3151 {
3152 switch (c)
3153 {
3154 case '#':
3155 FormatFixed(ref sb, ref number, nMaxDigits, info._currencyGroupSizes, info.CurrencyDecimalSeparator, info.CurrencyGroupSeparator);
3156 break;
3157 case '-':
3158 sb.Append(info.NegativeSign);
3159 break;
3160 case '$':
3161 sb.Append(info.CurrencySymbol);
3162 break;
3163 default:
3164 sb.Append(c);
3165 break;
3166 }
3167 }
3168 }
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_posCurrencyFormats
Definition Number.cs:1235
static readonly string[] s_negCurrencyFormats
Definition Number.cs:1237

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

Referenced by System.Number.NumberToString().