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

◆ FormatPercent()

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

Definition at line 760 of file FormatProvider.cs.

761 {
762 string text = (number.sign ? s_negPercentFormats[info.PercentNegativePattern] : s_posPercentFormats[info.PercentPositivePattern]);
763 string text2 = text;
764 foreach (char c in text2)
765 {
766 switch (c)
767 {
768 case '#':
769 FormatFixed(ref sb, ref number, nMinDigits, nMaxDigits, info, info.PercentGroupSizes, info.PercentDecimalSeparator, info.PercentGroupSeparator);
770 break;
771 case '-':
772 sb.Append(info.NegativeSign);
773 break;
774 case '%':
775 sb.Append(info.PercentSymbol);
776 break;
777 default:
778 sb.Append(c);
779 break;
780 }
781 }
782 }
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_posPercentFormats
static readonly string[] s_negPercentFormats

References System.Globalization.FormatProvider.Number.FormatFixed(), System.info, System.Globalization.FormatProvider.Number.s_negPercentFormats, System.Globalization.FormatProvider.Number.s_posPercentFormats, and System.text.

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