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
https://forums.phpfreaks.com/topic/49663-solved-negative-numbers/
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.

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.