SByte.ToString(String) converts numeric value to string using the specified format.
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
sbyte[] values = { -1, 0, 1 };
string[] specifiers = { "G", "C", "D3", "E2", "e3", "F",
"N", "P", "X", "00.0", "#.0",
"000;(0);**Zero**" };
foreach (sbyte value in values)
{
foreach (string specifier in specifiers){
Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier));
}
}
}
}
Related examples in the same category