Get the name of a number, even if it's stupidly big.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
Den här utvecklingskatalogen är arkiverad. Du kan se filer och klona katalogen, men inte öppna ärenden eller genomföra push- eller pull-förfrågningar.

17 rader
462 B

  1. import { Digit } from '../../../common'
  2. import NAMES from '../names'
  3. interface HundredTimes {
  4. (x100: Digit): string
  5. }
  6. /**
  7. * Get the name of some number in the hundreds place.
  8. * @param {number} x100 - The number in the hundreds place.
  9. * @returns {string} The name of the number in the hundreds place.
  10. */
  11. const hundredTimes: HundredTimes = (x100) =>
  12. x100 === 0 ? NAMES.units[0] : [NAMES.units[x100], NAMES.hundred].join(' ')
  13. export default hundredTimes