function parseNum(value: NumberType, options: ParseNumberParamsType = {}): string

Parses various input formats into a standard decimal string. Supports currencies ($€£¥), commas, underscores, scientific notation (e+), and custom subscript notation.

Params

  • value (NumberType): The input value to parse. Can be a number, string, or bigint.

Returns

(string): A standardized decimal string (e.g., "1234.56").

Example

value

parseNum(0)

Result: 0

function clearLeadingZero(value: string): string

Removes trailing zeros from a decimal string (e.g., '1.500' -> '1.5').

Params

  • value: string: The number string to clean.

Return

(string): The cleaned number string.

Example

value

clearTrailingZero(0)

Result:

function clearLeadingZero(value: string): string

Removes leading zeros from a string (e.g., '005' -> '5').

Params

  • value: string: The number string to clean.

Return

(string): The cleaned number string.

Example

value

clearLeadingZero(0)

Result: 0

function clearLeadingZero(value: string): string

Removes redundant leading and trailing zeros from a number string.

Params

  • value: string: The number string to clean.

Return

(string): The cleaned number string.

Example

value

clearUnnecessaryZero(0)

Result: 0

COPYRIGHT © 2026