Get the name of a number, even if it's stupidly big.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly a požadavky na natažení.

17 řádky
416 B

  1. import { GetKiloCount } from '../../NumberSystem'
  2. import constructTens from './construct/tens'
  3. import hundredTimes from './base/hundredTimes'
  4. const getKiloCount: GetKiloCount = (x100, x10, x1) => {
  5. if (x100 < 1) {
  6. return constructTens(x10, x1)
  7. }
  8. if (x10 === 0 && x1 === 0) {
  9. return hundredTimes(x100)
  10. }
  11. return [hundredTimes(x100), constructTens(x10, x1)].join(' ')
  12. }
  13. export default getKiloCount