new NumberFormatInfo() : NumberFormatInfo « System.Globalization « C# / C Sharp by API






new NumberFormatInfo()

  

using System;
using System.Globalization;
using System.Text;

public class NumParsingApp {
    public static void Main(string[] args) {

        string u = "AA -1,234,567.890  ";
        NumberFormatInfo ni = new NumberFormatInfo();
        ni.CurrencySymbol = "AA";
        double h = Double.Parse(u, NumberStyles.Any, ni);
        Console.WriteLine("h = {0:F}", h);
    }
}

   
    
  








Related examples in the same category

1.NumberFormatInfo.CurrencyGroupSeparator
2.NumberFormatInfo.CurrencySymbol
3.NumberFormatInfo.NumberDecimalSeparator
4.NumberFormatInfo.NumberGroupSeparator