@jiminp/tooltool
    Preparing search index...

    Function formatSignedInt

    • Formats a number with an explicit sign prefix (+, -, or ±).

      Parameters

      • n: number

        The number to format.

      • Optionalmin_len: number

        The minimum length of the numeric part (padding applied to absolute value).

      • Optionalfill_string: string

        The string used to pad the numeric part (default: ' ').

      Returns string

      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"