Skip to main content

Built and signed on GitHub Actions

This is my helper functions

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 months ago (0.2.2)
Package root>src>formatDateZero.ts
/** * Format a number to a string with 2 digits * * @example * ```ts * import { formatDateZero } from './formatDateZero'; * * formatDateZero(1); // '01' * formatDateZero(12); // '12' * ``` * * @param nb number * @returns string */ export const formatDateZero = (nb: number): string => nb.toString().padStart(2, '0');