num-pad

Simple function to pad the passed in number, if less than 10 return 0<num> otherwise just returns the number.

Usage no npm install needed!

<script type="module">
  import numPad from 'https://cdn.skypack.dev/num-pad';
</script>

README

num-pad

Num Pad is a simple number pad function. It adds a 0 infront of numbers less then 10.

Installing

npm install --save num-pad

Using:

const numPad = require("num-pad");

const april = numPad(4);
april === "04";

const december = numPad(12);
december === "12";