Support number prefixes above billion. (quadrillion-septillion)
See original GitHub issueSomewhat related: The trillion prefix doesn’t seem to work for me - instead I get 1undefined.
Is it possible to add the prefixes for quadrillion (P / 10^15), quintillion (E / 10^18), sextillion (Z / 10^21) and septillion (Y / 10^24)? I would have done it my self but don’t fully understand this section.
This is what I have so far:
Language:
e.language("en", {
delimiters: {
thousands: ",",
decimal: "."
},
abbreviations: {
thousand: "K",
million: "M",
billion: "B",
trillion: "T",
quadrillion: "P",
quintillion: "E",
sextillion: "Z",
septillion: "Y"
},
// rest of language code
});
(Number?) function snippet
var o = new RegExp(n[r].abbreviations.thousand + "(?:\\)|(\\" + n[r].currency.symbol + ")?(?:\\))?)?$"),
u = new RegExp(n[r].abbreviations.million + "(?:\\)|(\\" + n[r].currency.symbol + ")?(?:\\))?)?$"),
a = new RegExp(n[r].abbreviations.billion + "(?:\\)|(\\" + n[r].currency.symbol + ")?(?:\\))?)?$"),
f = new RegExp(n[r].abbreviations.trillion + "(?:\\)|(\\" + n[r].currency.symbol + ")?(?:\\))?)?$"),
Pvariable = new RegExp(n[r].abbreviations.quadrillion + "(?:\\)|(\\" + n[r].currency.symbol + ")?(?:\\))?)?$"),
Evariable = new RegExp(n[r].abbreviations.quintillion + "(?:\\)|(\\" + n[r].currency.symbol + ")?(?:\\))?)?$"),
Zvariable = new RegExp(n[r].abbreviations.sextillion + "(?:\\)|(\\" + n[r].currency.symbol + ")?(?:\\))?)?$"),
Yvariable = new RegExp(n[r].abbreviations.septillion + "(?:\\)|(\\" + n[r].currency.symbol + ")?(?:\\))?)?$"),
Issue Analytics
- State:
- Created 10 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Names of large numbers - Wikipedia
Names of numbers above a trillion are rarely used in practice; such large numbers have practical usage primarily in the scientific domain, where...
Read more >Number words and prefixes.
Words for large numbers ; Number word. Millions scheme. Thousands scheme ; million. 10 · 10 ; billion (Latin bi-, twice). 10 ·...
Read more >Metric Numbers - Math is Fun
"kilo" for a thousand,; "mega" for a million,; and more ... long rope ... Here we list the prefix for commonly used big...
Read more >Large number abbreviations
Large number abbreviations ; q, Quadrillion, 10^15 ; Q · Quintillion, 10^18 ; s, Sextillion, 10^21 ; S · Septillion, 10^24 ...
Read more >Naming Large Numbers
billion. 10 9. trillion. 10 12. quadrillion. 10 15. quintillion. 10 18. sextillion. 10 21. septillion. 10 24. octillion. 10 27. nonillion. 10...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

+1
Strangely, while “trillion” is already in the library, this fails with
undefined:I don’t know why exactly you need a regex for each unit, this is not really effective and leads to bloat very quickly.
I’d suggest to use something that scales along with the amount of units. Like so:
Hope I were able to help in a way.