Hello people, can someone show me how to work with those giant numbers that use idle games?
ty!
huge numbers
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: huge numbers
I'll just assume you want to print to console or game window a huge number without scientific notation. Then, i guess that would be:
Code: Select all
love.graphics.print(string.format("%.0f", variable))
https://github.com/Sulunia
Re: huge numbers
You'll want to use a library that represents those numbers as a combination of Lua primitive values. Something like this: https://bitbucket.org/tedu/bigintlua/src/tip/bigint.lua
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: huge numbers
If your huge numbers are "whole", that is, they have nothing after a decimal... point, comma or whatever symbol you might use, and they fit inside the double datatype lua (and löve) uses (that is, if the numbers are smaller than 2^53, or 9 007 199 254 740 992) then use what Sulunia suggested, otherwise you can use what Tanner linked.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot] and 5 guests