Gets the name of a number, even if it's stupidly big. Supersedes TheoryOfNekomata/number-name.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 regels
532 B

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