NOTE!
- In Updated 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 |
---|---|
5 hundred | one hundred and fifty two million |
four hundred thousand five hundred fourty three | 710,231,000 |
one hundred and fifty five | 10 million, three hundred sixty five thousand, four hundred and ninety one |
negative twelve | 10 million and three |
minus three hundred and fifty seven thousand four hundred and two | 6 billion eight thousand |
zero | 3 hundred quadrillion |
three hundred twenty | 145 decillion |
forty-two | 700 thousand |
ninety-nine thousand nine hundred and ninety-nine | 2.3 million |
2.3 thousand | 2.3 googl |
minus one | 8 hundred thousand |
seven hundred fifty two | 9 hundred-million |
one hundred and thirty-three | Twenty-three trillion |
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>
Javascript
$(function() {
$("table").tablesorter({
theme : 'blue',
widgets : ["zebra"]
});
});
HTML
<table class="tablesorter">
<thead>
<tr>
<th class="sorter-namedNumbers">Numbers</th>
<th class="sorter-namedNumbers">Large Numbers</th>
</tr>
</thead>
<tbody>
<tr>
<td>5 hundred</td>
<td>one hundred and fifty two million</td>
</tr>
<tr>
<td>four hundred thousand five hundred fourty three</td>
<td>710,231,000</td>
</tr>
<tr>
<td>one hundred and fifty five</td>
<td>10 million, three hundred sixty five thousand, four hundred and ninety one</td>
</tr>
<tr>
<td>negative twelve</td>
<td>10 million and three</td>
</tr>
<tr>
<td>minus three hundred and fifty seven thousand four hundred and two</td>
<td>6 billion eight thousand</td>
</tr>
<tr>
<td>zero</td>
<td>3 hundred quadrillion</td>
</tr>
<tr>
<td>three hundred twenty</td>
<td>145 decillion</td>
</tr>
<tr>
<td>forty-two</td>
<td>700 thousand</td>
</tr>
<tr>
<td>ninety-nine thousand nine hundred and ninety-nine</td>
<td>2.3 million</td>
</tr>
<tr>
<td>2.3 thousand</td>
<td>2.3 googl</td>
</tr>
<tr>
<td>minus one</td>
<td>8 hundred thousand</td>
</tr>
<tr>
<td>seven hundred fifty two</td>
<td>9 hundred-million</td>
</tr>
<tr>
<td>one hundred and thirty-three</td>
<td>Twenty-three trillion</td>
</tr>
</tbody>
</table>