Type alias Negate<T>

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

Negate a number

Type Parameters

  • T extends NumberLike

    The number to negate

    type Example = Negate<"-300">
    

Generated using TypeDoc