Format float value: P
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
float value = 1234567.123456F;
string specifier;
CultureInfo culture;
specifier = "P";
culture = CultureInfo.InvariantCulture;
Console.WriteLine((value/10000).ToString(specifier, culture));
culture = CultureInfo.CreateSpecificCulture("ar-EG");
Console.WriteLine((value/10000).ToString(specifier, culture));
}
}
//12,345.67 %
//12,345.670 %
Related examples in the same category