Get the name of a number, even if it's stupidly big.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
このリポジトリはアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュや、課題・プルリクエストのオープンはできません。

24 行
639 B

  1. import NAMES from './names.json'
  2. import { GetKiloCount } from '../../NumberSystem'
  3. import constructTens from './construct/tens'
  4. import hundredTimes from './base/hundredTimes'
  5. const getKiloCount: GetKiloCount = (x100, x10, x1) => {
  6. if (x100 < 1) {
  7. return constructTens(x10, x1)
  8. }
  9. if (x10 === 0) {
  10. if (x1 === 0) {
  11. return hundredTimes(x100)
  12. }
  13. return [hundredTimes(x100), NAMES.and, constructTens(0, x1)].join(' ')
  14. }
  15. if (x1 === 0) {
  16. return [hundredTimes(x100), NAMES.and, constructTens(x10, x1)].join(' ')
  17. }
  18. return [hundredTimes(x100), constructTens(x10, x1)].join(' ')
  19. }
  20. export default getKiloCount