Jump to content

Storing very large numbers need help


cdoyle

Recommended Posts

Hello,

this has been a topic that has confused me for awhile, and not sure how to get around it.

 

I have an RPG and the players have bank accounts,  but after several years of game play.   Some players are running into issues where we just can't store large numbers in the database anymore.

http://www.caraudiocentral.net/CAC_Mafia_Life

 

I currently have the field as BIGINT(20).

 

I've read that one solution is to use a VARCHAR,  but you can't do any math calculations with this.   So this isn't a solution for me,  since this is game cash,  and it has to be calulated everytime a transaction is done.

 

What are my options with these very large numbers?

 

Thanks

Chris

Link to comment
https://forums.phpfreaks.com/topic/284340-storing-very-large-numbers-need-help/
Share on other sites

Is the field set to unsigned? If you don't need negative values, you could switch to unsigned. More information here:

http://dev.mysql.com/doc/refman/5.0/en/integer-types.html

 

I was just coming back to edit my post to say that it's unsigned currently.

A signed BIGINT at allows values up to

nine quintillion, two hundred twenty-three quadrillion, three hundred seventy-two trillion, thirty-six billion, eight hundred fifty-four million, seven hundred seventy-five thousand, eight hundred seven

Or 9,223,372,036,854,775,807.

 

If that's not enough for your currency or whatever then you really need to change the currency. Not even the Zimbabwean dollar is that bad.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.