NOTE!
- In v2.25.5, added an example that uses the huge number parser.
- The largest number (
MAX_SAFE_INTEGER
) that javascript can handle is9,007,199,254,740,991
. - Anything larger and the number gets rounded off, so that's why this parser was created.
- The largest number (
- In v2.22.0, this parser will now ignore commas, periods and quotes adjacent to the named number word (e.g. "10 million, three...").
- This parser will convert named numbers into appropriate values so they are sorted correctly.
- Named numbers include values:
- zero to twenty; by one ("one", "two", "three", ..., "nineteen", "twenty")
- twenty to hundred; by ten ("twenty", "thirty", "forty", ... "ninety", "hundred")
- thousand (1e3) to duotrigintillion (1e99); by 10^(3n+3) value ("thousand", "million", "billion", ... "untrigintillion", "duotrigintillion")
- googl (1e100)
- Even bigger named values will need to be manually added to the parser code; see this wikipedia page for more names.
Demo
Numbers | Large Numbers | Huge Numbers |
---|---|---|
5 hundred | one hundred and fifty two million | 110,000,000,000,000,001 |
four hundred thousand five hundred fourty three | 710,231,000 | 110,000,000,000,000,000 |
one hundred and fifty five | 10 million, three hundred sixty five thousand, four hundred and ninety one | 110,000,000,000,000,005 |
negative twelve | 10 million and three | 110,000,000,000,000,003 |
minus three hundred and fifty seven thousand four hundred and two | 6 billion eight thousand | 110,000,000,000,000,012 |
zero | 3 hundred quadrillion | 110,000,000,000,000,002 |
three hundred twenty | 145 decillion | 110,000,000,000,000,010 |
forty-two | 700 thousand | 110,000,000,000,000,007 |
ninety-nine thousand nine hundred and ninety-nine | 2.3 million | 110,000,000,000,000,009 |
2.3 thousand | 2.3 googl | 110,000,000,000,000,008 |
minus one | 8 hundred thousand | 110,000,000,000,000,021 |
seven hundred fifty two | 9 hundred-million | 110,000,000,000,000,011 |
one hundred and thirty-three | Twenty-three trillion | 110,000,000,000,000,100 |
Page Header
<!-- blue theme stylesheet with additional css styles added in v2.0.17 --> <link rel="stylesheet" href="../css/theme.blue.css"> <!-- tablesorter plugin --> <script src="../js/jquery.tablesorter.js"></script> <!-- load metric parser --> <script src="../js/parsers/parser-named-numbers.js"></script>