// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Globalization; namespace E { public class Program { public static void Main(string[] args) { NumberFormatInfo nfi = new NumberFormatInfo(); nfi.CurrencyDecimalSeparator = "."; nfi.CurrencyGroupSeparator = ","; nfi.CurrencySymbol = "$"; string val1 = "$100,000"; string val2 = "$45"; decimal d1 = decimal.Parse(val1, NumberStyles.Currency, nfi); decimal d2 = decimal.Parse(val2, NumberStyles.Currency, nfi); Console.WriteLine(d1/d2); } } }