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.

17 lines
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