Gets the name of a number, even if it's stupidly big. Supersedes TheoryOfNekomata/number-name.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

19 行
500 B

  1. import enPH from './locales/en-PH'
  2. import {
  3. Numeric,
  4. } from './utils/numeric';
  5. type Options = {
  6. groupSeparator: string,
  7. locale?: (xRaw: Numeric, options?: Partial<Omit<Options, 'locale'>>) => string,
  8. }
  9. type GetNumberName = (number: Numeric, options?: Partial<Options>) => string
  10. const getNumberName: GetNumberName = (number, options = {} as Partial<Options>): string => {
  11. const { locale = enPH, ...etcOptions } = options
  12. return locale(number, etcOptions)
  13. }
  14. export default getNumberName