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

◆ MSNumber()

static double System.Xml.Xsl.Runtime.XsltFunctions.MSNumber ( IList< XPathItem > value)
inlinestatic

Definition at line 279 of file XsltFunctions.cs.

280 {
281 if (value.Count == 0)
282 {
283 return double.NaN;
284 }
286 string value2;
287 if (xPathItem.IsNode)
288 {
289 value2 = xPathItem.Value;
290 }
291 else
292 {
293 Type valueType = xPathItem.ValueType;
294 if (!(valueType == XsltConvert.StringType))
295 {
296 if (valueType == XsltConvert.DoubleType)
297 {
298 return xPathItem.ValueAsDouble;
299 }
300 if (!xPathItem.ValueAsBoolean)
301 {
302 return 0.0;
303 }
304 return 1.0;
305 }
306 value2 = xPathItem.Value;
307 }
308 if (XmlConvert.TryToDouble(value2, out var result) != null)
309 {
310 return double.NaN;
311 }
312 return result;
313 }

References System.Xml.Dictionary, System.Xml.Xsl.Runtime.XsltConvert.DoubleType, System.Xml.Xsl.Runtime.XsltConvert.StringType, System.Xml.XmlConvert.TryToDouble(), and System.value.