Formats a number with an explicit sign prefix (+, -, or ±).
The number to format.
Optional
The minimum length of the numeric part (padding applied to absolute value).
The string used to pad the numeric part (default: ' ').
The formatted string including the sign.
Zero (0) is denoted with '±'.
formatSignedInt(42); // "+42"formatSignedInt(-5); // "-5"formatSignedInt(0); // "±0"formatSignedInt(5, 3, '0'); // "+005" Copy
formatSignedInt(42); // "+42"formatSignedInt(-5); // "-5"formatSignedInt(0); // "±0"formatSignedInt(5, 3, '0'); // "+005"
Formats a number with an explicit sign prefix (+, -, or ±).