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

◆ FormatItem()

void System.Xml.Xsl.Runtime.NumberFormatter.FormatItem ( StringBuilder sb,
XPathItem item,
char startChar,
int length )
inlineprivate

Definition at line 115 of file NumberFormatter.cs.

116 {
117 double num = ((!(item.ValueType == typeof(int))) ? XsltFunctions.Round(item.ValueAsDouble) : ((double)item.ValueAsInt));
118 char zero = '0';
119 switch (startChar)
120 {
121 case 'A':
122 case 'a':
123 if (num <= 2147483647.0)
124 {
125 NumberFormatterBase.ConvertToAlphabetic(sb, num, startChar, 26);
126 return;
127 }
128 break;
129 case 'I':
130 case 'i':
131 if (num <= 32767.0)
132 {
133 NumberFormatterBase.ConvertToRoman(sb, num, startChar == 'I');
134 return;
135 }
136 break;
137 default:
138 zero = (char)(startChar - 1);
139 break;
140 case '1':
141 break;
142 }
144 }
StringBuilder Append(char value, int repeatCount)
static unsafe string ConvertToDecimal(double val, int minLen, char zero, string groupSeparator, int groupSize)

References System.Xml.Xsl.Runtime.NumberFormatter._groupingSeparator, System.Xml.Xsl.Runtime.NumberFormatter._groupingSize, System.Text.StringBuilder.Append(), System.Xml.Xsl.Runtime.NumberFormatterBase.ConvertToAlphabetic(), System.Xml.Xsl.Runtime.NumberFormatter.ConvertToDecimal(), System.Xml.Xsl.Runtime.NumberFormatterBase.ConvertToRoman(), System.Xml.Dictionary, System.item, System.length, and System.Xml.Xsl.Runtime.XsltFunctions.Round().

Referenced by System.Xml.Xsl.Runtime.NumberFormatter.FormatSequence().