Type alias NegativeFloatString<S>

NegativeFloatString<S>: IfEquals<IsNegativeFloat<Float<NumerifyString<S>>>, true, Float<NumerifyString<S>>, never>

Represents a negative float parsed from a string. If the string does not represent a negative float, it resolves to never, else it resolves to its float representation.

Type Parameters

  • S extends string

Example

   NegativeFloatString<'0'>; // never
NegativeFloatString<'82739283293237'>; // never
NegativeFloatString<'-82739.283293237'>; // works
NegativeFloatString<'-1'>; // never
NegativeFloatString<'-1.98'>; // works