CSharp examples for System:Decimal
Convert String to Decimal Value Or Null
using System.Text; using System.IO;/* w w w.j a v a 2 s . c om*/ using System.Globalization; using System.Collections.Generic; using System; public class Main{ public static decimal? DecimalValueOrNull(this string value) { decimal result; if (decimal.TryParse(value, out result)) { return result; } else { return null; } } }