ChronoDK / GodotBigNumberClass

Use very BIG numbers in Godot Engine games.
MIT License
116 stars 27 forks source link

Consider supporting metric prefixes #1

Closed aaronfranke closed 4 years ago

aaronfranke commented 4 years ago

I noticed that for declaring large numbers, it quickly switches away from conventional prefixes and instead uses AA, AB, etc. Why not support metric prefixes? This would be useful in many contexts.

Also, consider making your code conform to the GDScript style guide, since it can help users read your code and contribute more easily.

ChronoDK commented 4 years ago

Hi Aaron, thank you for commenting. As for the AA, AB notation stuff I'm following a convention these kinds of games uses. You can read more about it here: https://gram.gs/gramlog/formatting-big-numbers-aa-notation/ Metric notation would be a cool thing to add though, but it would be limited to some range right? I would also like to add the short and long scale number names: https://googology.wikia.org/wiki/Quattuorquinquagintillion I have made another game that uses these, though that is some years ago.

Can you specify the things from the style guide I'm missing? I'm just writing .gd the way I always have. Would not mind changing it for readability.

aaronfranke commented 4 years ago

In particular, spaces after colons, spaces after commas, spaces around = and / etc, comments starting with a capital letter and ending with a period, two lines between functions, tabs for indentation, and snake_case names. You also have stray indentation outside of a function on line 72.

If there is anything on the style guide you disagree with, feel free to ignore it. It's a guide, not a requirement. But you should follow it unless you have a specific reason to stray from it, and partially following it is better than not following it at all.

but it would be limited to some range right?

The largest metric prefix listed there is Y with a value of 10^24. However, if you wish to extend this, there appears to be a pattern near the end with Z -> Y, so you could possibly extend it with X -> W -> V -> U though you can't use T after U.

Also: Officially thousand is k but K is also really common.

ChronoDK commented 4 years ago

I found some time to improve this a bit. I added long name notation like octovigintillion or sextrigintillion, and also metric symbol and metric name notation (falls back to scientific).

Made some style improvements as well. Not everything I can change though, as I would have to change my game as well.