NameSilo

SQL Question - Column Datatype

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
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: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back