import { Digit, GetKiloName } from '../../common' import NAMES from './names' import getKiloCombiningPrefix from './base/kilo/combiningPrefix' const getEuropeanLongKiloName: GetKiloName = (thousandPower) => { if (thousandPower === 0n) { return '' } if (thousandPower === 1n) { return NAMES.thousand } const kilo = thousandPower const kiloHundreds = kilo / 2n / 100n const kiloTens = (Number(kilo / 2n / 10n) % 10) as Digit const kiloOnes = (Number(kilo / 2n) % 10) as Digit const kiloCombiningPrefix = getKiloCombiningPrefix(kiloHundreds, kiloTens, kiloOnes) return thousandPower % 2n === 0n ? kiloCombiningPrefix + NAMES.kiloEvenSuffix : kiloCombiningPrefix + NAMES.kiloOddSuffix } export default getEuropeanLongKiloName