Type alias PositiveFloatString<S>

PositiveFloatString<S>: IfEquals<IsPositiveFloat<Float<NumerifyString<S>>>, true, Float<NumerifyString<S>>, never>

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

Type Parameters

  • S extends string

Example

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