Timeline for What data-type should I use for in-game currency?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 8, 2013 at 22:57 | comment | added | Pieter Geerkens | However, use Basis Points not Cents (where 100 Basis Points = 1 cent) with a factor of 10,000 instead of 100. This is required by GAAP for all Financial, Banking or Accounting applications. | |
Apr 8, 2013 at 11:32 | comment | added | Lucas Tulio | Just a disclaimer: I changed the correct answer to this one because it ended up being what I used. It's much simpler and in the context of such a simple game, the unaccounted decimals don't really matter. | |
Apr 8, 2013 at 1:49 | vote | accept | Lucas Tulio | ||
Dec 22, 2012 at 16:14 | comment | added | Lucas Tulio | +1. Sounds like a good way to go for my game. I'll deal with rounding the ints myself and stay away from all the float problems. | |
Dec 22, 2012 at 15:49 | vote | accept | Lucas Tulio | ||
Dec 22, 2012 at 16:06 | |||||
Dec 22, 2012 at 0:18 | comment | added | Dobes Vandermeer | +1. Floating point numbers screw up equality comparisons, they are harder to format properly, and introduce funny rounding errors over time. It's better to do all that stuff yourself so you don't get complaints about it later. It really isn't a lot of work. | |
Dec 21, 2012 at 18:45 | comment | added | sam hocevar |
If you use round there is no real reason to cast down to int , is there?
|
|
Dec 21, 2012 at 15:40 | history | answered | bobobobo | CC BY-SA 3.0 |