Jump to content

[SOLVED] Negative Numbers


cheyner

Recommended Posts

I am trying to insert a negative number in my database (mySQL) using PHP. The table column is a decimal number (20,2) and it is a negative amount of money. For the life of me, it will not insert as a negative, it returns a positive number.

 

Any ideas on fixing this?

 

I am also using WAMP server and for some reason I cannot get money_format() working. Does anyone know a quick and dirty function that will convert a stored number to look like currency?

 

Thanks in advance for your help.

Link to comment
Share on other sites

I know what other people think but lately I have been using varchar for almost anything related with numbers (even timestamps).

It's so much easier.  With any thing number related "except double for dollar amounts", I have had problems.  Whenever I use varchar it always seems to work perfectly.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.