Welcome Guest, Not a member yet? Register   Sign In
Storing negative values in MySQL
#1

[eluser]megabyte[/eluser]
I am building an inventory table. It needs to store addition of inventory and substraction of inventory.

Now I realize you can store a negative number but this is something I've never done before, so I'm trying to think about pros and cons.

If I allow the user to enter a negative value in a text field, I could check that the value only contains a '-.0-9' (I'llhave to play with this because I'm not a regular expressions expert) now is their a way to make sure in a regex their is only one instance of the '-'

And has anyone had issue allowing users to store negative numbers that later need to be calculated on? This is my biggest worry of course.


Messages In This Thread
Storing negative values in MySQL - by El Forum - 01-15-2010, 03:39 PM
Storing negative values in MySQL - by El Forum - 01-15-2010, 05:16 PM
Storing negative values in MySQL - by El Forum - 01-15-2010, 05:17 PM
Storing negative values in MySQL - by El Forum - 01-15-2010, 05:23 PM
Storing negative values in MySQL - by El Forum - 01-16-2010, 02:30 AM
Storing negative values in MySQL - by El Forum - 01-16-2010, 04:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB