CSharp examples for System.Xml:XML Element
Get Decimal from XmlElement
using System.Xml; using System.Text; using System.Collections.Generic; using System;/*from w w w. ja v a 2 s .co m*/ public class Main{ public static decimal GetDecimal(XmlElement source, string childName) { string txt = GetText(source, childName); return string.IsNullOrEmpty(txt) ? 0M : decimal.Parse(txt); } public static decimal GetDecimal(XmlElement source, string childName, IFormatProvider formatProvider) { string txt = GetText(source, childName); return string.IsNullOrEmpty(txt) ? 0M : decimal.Parse(txt, formatProvider); } }