Maybe you could have multiple variables to store that number. You could have one named "thousand", which will store a value from 0 to 999. And you can have another one called "million" that also stores values from 0 to 999. To read that number you'll have to get the values as strings, and if you put billion, million, thousand variables in that order, you should get the right value. Each iteration, you divide by 2 every variable or multiply by 3 every variable and add 1 to the "thousand" variable. Then check if any variable is higher than or equal to 1000, to substract 1000 from that variable and add 1 to the next variable. Let's say "thousand" equals 1274 and "million" equals 70 after the iteration. "Thousand" now equals 274 and "million" equals 71. The same for decimal numbers after dividing. You substract 0.5 from the higher variable and add 500 to the lower one. I don't know what could be the best way to optimize this in terms of codespace and/or lag. Hopefully someone with more experience with coding can tell you exactly how to do this, but I hope this idea helps.