Get the name of a number, even if it's stupidly big.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

15 lines
348 B

  1. import NAMES from '../names.json'
  2. interface TenPlus {
  3. (ones: number): string
  4. }
  5. /**
  6. * Get the name of some number plus ten.
  7. * @param {number} x1 - The number in the ones place.
  8. * @returns {string} The name of the number plus ten.
  9. */
  10. const tenPlus: TenPlus = (x1) => (x1 === 0 ? NAMES.tenTimes[1] : NAMES.tenPlus[x1])
  11. export default tenPlus