Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

SQL Question - Column Datatype

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

boomers

Established Member
Impact
4
I've tried an integer column and a decimal column but whenever I try to input the figure '11.50' it automatically changes it to '12'.

I'm also using the SUM() function on these columns so using varchar or something similar isn't an option.

I cant see why my figure changes within an integer or decimal column.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
What does your PHP code look like?
 
0
Close
Just declaring the field as decimal is not enough, you need to provide scale/precision, example: decimal(6,2) makes room for 2 decimals.
 
0
Close
Just declaring the field as decimal is not enough, you need to provide scale/precision, example: decimal(6,2) makes room for 2 decimals.

This was indeed the problem, appreciate your reply :)
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back