Jump to content
Sign in to follow this  
Darkness

Money values

Recommended Posts

Hello,Here I am again... Already. Anyways, lately, I have been having issues with Money and the sort. How should I do this? (Like, Money on an RPG, so you can buy Items). Some say I should store it in an SQL... The issue is: The money value has to be atleast 999,999,999. However, when I try to create a Longblob or Longtext (or any blobs or text fields), it won't work. Well, if you try to in a script, which I what I need to do, for certain reasons. Doubt it would even work if I created it from the database.Anyways, others have suggested using fopen. How could that be possible?Sorry if it's not quite clear.Thanks.

Share this post


Link to post
Share on other sites

You're working with a number, you don't need a long blob. A long blob stores several megabytes of binary data, you don't need several megabytes of binary data to store a 9-digit number. Use an integer column if you only need whole numbers, if you need decimals then use a float. The database does not store commas so leave those out when you work with the number, use PHP to add the commas when you write the number on the page.

Share this post


Link to post
Share on other sites

Cool. However, integers seem to allow only 255 characters (BigInt). Oh, wait. Would that mean if I entered 9, it would allow me to use 9 digits in the number?Thanks.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...