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

17 行
469 B

  1. import { Digit } from '../../../common'
  2. import NAMES from '../names'
  3. interface HundredTimes {
  4. (x100: Digit): string
  5. }
  6. /**
  7. * Get the name of some number in the hundreds place.
  8. * @param {number} x100 - The number in the hundreds place.
  9. * @returns {string} The name of the number in the hundreds place.
  10. */
  11. const hundredTimes: HundredTimes = (x100) =>
  12. Number(x100) === 0 ? NAMES.units[0] : [NAMES.units[x100], NAMES.hundred].join('')
  13. export default hundredTimes