Answers for "Big Numbers - How to convert (k, M, a )"
http://answers.unity.com/questions/1552975/big-numbers-how-to-convert-k-m-a.html
The latest answers for the question "Big Numbers - How to convert (k, M, a )"Answer by Eno-Khaon
http://answers.unity.com/answers/1553010/view.html
If you're especially worried about perfect accuracy, you may want to dig around the internet a bit to find a solution that's suitable for your needs. The first few examples I found as far as related links go include <b>[here][1]</b> and <b>[here][2]</b>.
<br> <br>
If 100% perfect accuracy isn't important (and, looking at this realistically, it might not be when you consider that 150,000 out of 500 duoquinquagintillion is genuinely insignificant), you could try taking a different approach to this.
<br> <br>
For example, you might consider comprising your values of a pair of numbers. The first would be the general value, where the second is the exponent of 10 to apply to it. If you had a base value of 3.424126 and an exponent of 10, the resulting number would be 34,241,260,000. It's fundamentally like what floating point numbers do internally, but you'd just assemble the number yourself (seeing how the first number would even be a float in the first place).
<br> <br>
To compare values, you'd multiply the difference in exponents with the base value. For example,
<br>
3.4<sup>e10</sup> - 2.2<sup>e9</sup> = 3.18<sup>e10</sup>
<br>
3.4 - (2.2 * 10<sup>9-10</sup>) = 3.18
<br>
3.4 - (2.2 * 10<sup>-1</sup>) =3.18
<br>
3.4 - 0.22 = 3.18
<br> <br>
If the difference between values is greater than a number of significant digits specified (for instance, Unity's floating point has 7 digits of accuracy), then the difference can potentially be considered large enough to ignore the math altogether.
<br>
3.4<sup>e10</sup> - 5<sup>e2</sup>
<br>
2 - 10 = -8
<br>
|-8| > 7 (accuracy)
<br>
As far as it matters...
<br>
3.4<sup>e10</sup> - 5<sup>e2</sup> = 3.4<sup>e10</sup>
<br> <br>
If you put together a general value-type script to utilize number pairs in that manner, you can also make quick assumptions for shortcuts. For instance, if the exponent for a "purchase" is greater than your current "money" exponent, you already know you can't afford it.
<br> <br>
Edit: For additional reading, <b>[consider this list of large number naming conventions][3]</b>.
[1]: https://forum.unity.com/threads/c-solution-for-big-numbers.334590/
[2]: https://gamedev.stackexchange.com/questions/114911/how-do-idle-games-handle-such-large-numbers
[3]: https://www.quora.com/What-comes-after-a-million-billion-trillionFri, 14 Sep 2018 03:55:22 GMTEno-Khaon