DEV Community

Guilherme Siquinelli
Guilherme Siquinelli

Posted on

Numerical formatting from 0 to 99 with autocomplete sorted correctly. TypeScript series: Template literal types

type N = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

type Note = `0${N}` | `${N}0` | `${N}${N}`
Enter fullscreen mode Exit fullscreen mode

Top comments (0)