Type alias Abs<T>

Abs<T>: UnsafeParseNumber<T> extends number
    ? T extends `-${infer V}`
        ? V
        : T
    : never

Absolute value of a number

Type Parameters

  • T extends NumberLike

    The number to get the absolute value of

    type Example = Abs<"-300">
    

Generated using TypeDoc