SByte.ToString(IFormatProvider) converts numeric value to string with culture-specific format
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
NumberFormatInfo nfi = new NumberFormatInfo();
nfi.NegativeSign = "~";
sbyte[] bytes = { -122, 17, 124 };
foreach (sbyte value in bytes){
Console.WriteLine(value.ToString(nfi));
}
Console.WriteLine("Using the invariant culture:");
foreach (sbyte value in bytes){
Console.WriteLine(value.ToString(NumberFormatInfo.InvariantInfo));
}
}
}
Related examples in the same category