import { GetKiloCount } from '../../common' import NAMES from './names' import constructTens from './construct/tens' import hundredTimes from './base/hundredTimes' const getKiloCount: GetKiloCount = (x100, x10, x1) => { if (x100 < 1) { return constructTens(x10, x1) } if (x10 === 0) { if (x1 === 0) { return hundredTimes(x100) } return [hundredTimes(x100), NAMES.and, constructTens(0, x1)].join(' ') } if (x10 === 1 || x1 === 0) { return [hundredTimes(x100), NAMES.and, constructTens(x10, x1)].join(' ') } return [hundredTimes(x100), constructTens(x10, x1)].join(' ') } export default getKiloCount