Formats a number with an explicit sign prefix (+, -, or ± for zero).
+
-
±
The number to format.
Optional
Minimum length of the numeric part (pads absolute value).
Padding string (default: ' ').
' '
The formatted string with sign prefix.
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±for zero).