Parse a floating-point value with a thousands separator.
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
string value;
float number;
value = "1,234.56";
if (Single.TryParse(value, out number))
Console.WriteLine(number);
else
Console.WriteLine("Unable to parse '{0}'.", value);
}
}
Related examples in the same category