|
- import { GetKiloCount, Digit } from '../../common'
- import constructTens from './construct/tens'
- import hundredTimes from './base/hundredTimes'
-
- const getKiloCount: GetKiloCount = (x100Raw, x10, x1) => {
- const x100 = Number(BigInt(x100Raw) % 10n) as Digit
- if (x100 < 1) {
- return constructTens(x10, x1)
- }
-
- if (x10 === 0 && x1 === 0) {
- return hundredTimes(x100)
- }
-
- return [hundredTimes(x100), constructTens(x10, x1)].join(' ')
- }
-
- export default getKiloCount
|