Gets the name of a number, even if it's stupidly big. Supersedes TheoryOfNekomata/number-name.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

27 řádky
1.5 KiB

  1. import getNumberName from '../..';
  2. describe('Custom numbers', () => {
  3. it('converts 123456000 to one hundred twenty three million four hundred fifty six thousand', () => {
  4. expect(getNumberName(123456000)).toBe('one hundred twenty three million four hundred fifty six thousand')
  5. })
  6. it('converts 123456000 to one hundred twenty three million four hundred fifty six thousand nine', () => {
  7. expect(getNumberName(123456009)).toBe('one hundred twenty three million four hundred fifty six thousand nine')
  8. })
  9. it('converts 123000789 to one hundred twenty three million seven hundred eighty nine', () => {
  10. expect(getNumberName(123000789)).toBe('one hundred twenty three million seven hundred eighty nine')
  11. })
  12. it('converts 123050789 to one hundred twenty three million fifty thousand seven hundred eighty nine', () => {
  13. expect(getNumberName(123050789)).toBe('one hundred twenty three million fifty thousand seven hundred eighty nine')
  14. })
  15. it('converts 123456789 to one hundred twenty three million four hundred fifty six thousand seven hundred eighty nine', () => {
  16. expect(getNumberName(123456789)).toBe('one hundred twenty three million four hundred fifty six thousand seven hundred eighty nine')
  17. })
  18. it('converts -123456789 to negative one hundred twenty three million four hundred fifty six thousand seven hundred eighty nine', () => {
  19. expect(getNumberName(-123456789)).toBe('negative one hundred twenty three million four hundred fifty six thousand seven hundred eighty nine')
  20. })
  21. })