Get the name of a number, even if it's stupidly big.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
To repozytorium jest zarchiwizowane. Możesz wyświetlać pliki i je sklonować, ale nie możesz do niego przepychać zmian lub otwierać zgłoszeń/Pull Requestów.

19 wiersze
475 B

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