erosson / swarm-numberformat

Format large numbers in several human-readable ways. Designed for incremental games like swarmsim.
https://erosson.github.io/swarm-numberformat/
MIT License
89 stars 10 forks source link

dynamic suffixes #16

Open erosson opened 7 years ago

erosson commented 7 years ago

Remove the hardcoded suffix lists. Build a full suffix from parts; like, "undecillion" = index 11 = 1 + 10 = "un" + "decillion". Smaller hardcoded list, smaller file size, support for far larger suffixes than our current 1e270ish. Downsides: internationalization gets trickier, non-JS languages can't use our suffix list anymore, more complex code. All well worth it.

This has been done here: https://www.reddit.com/r/incremental_games/comments/5nn5x5/swarmnumberformat_a_js_library_for_nicely/dd9jhin/

...from this source:
http://www.isthe.com/chongo/tech/math/number/howhigh.html
https://www.reddit.com/r/incremental_games/comments/5g5cjn/what_number_representation_do_you_prefer/daq5fv8/

Other possible sources are also discussed in that reddit link:
http://googology.wikia.com/wiki/Googology_Wiki

erosson commented 7 years ago

Also, a Perl implementation, from Reddit post

ghost commented 7 years ago

The Perl implementation is actually the same (human) source as the first one listed in your Feb 3 comment ... they are both from ~chongo on isthe.com