Format a Number in Scientific Notation in C#
Format doubles and integers in scientific (exponential) notation in C# with the E format specifier or custom patterns like 0.##E+0, with culture-safe output.
Format doubles and integers in scientific (exponential) notation in C# with the E format specifier or custom patterns like 0.##E+0, with culture-safe output.
Indent text in C# with new string(‘ ‘, n), PadLeft, alignment in interpolated strings and IndentedTextWriter, including multi-line strings and columns.
Format integers as hex with the X specifier, parse hex strings back with int.Parse or Convert.ToInt32, and convert byte arrays with Convert.ToHexString.
Format dates in C# with custom patterns like yyyy-MM-dd and standard formats like “o”, plus a specifier table and the culture traps that change output.
Format a double with a fixed or maximum number of decimal places, leading zeros and thousands separators in C#, and avoid the culture and rounding traps.