Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
-
C_Calav
- Forum Contributor
- Posts: 395
- Joined: Wed Jun 02, 2004 10:55 pm
- Location: New Zealand
Post
by C_Calav »
hi guys,
my feild in my DB is
decimal(10,0)
but when i put for instance 67.50 into the DB it comes out as 67.
can anyone help me with what i am doing wrong?
thanx !
Last edited by
C_Calav on Tue Feb 08, 2005 7:32 pm, edited 1 time in total.
-
C_Calav
- Forum Contributor
- Posts: 395
- Joined: Wed Jun 02, 2004 10:55 pm
- Location: New Zealand
Post
by C_Calav »
Hi Timvw,
how can i get it to insert as 67.50 (two dp)
what do i need to change i didnt see how to get two DP in the link
-
C_Calav
- Forum Contributor
- Posts: 395
- Joined: Wed Jun 02, 2004 10:55 pm
- Location: New Zealand
Post
by C_Calav »
do i change it to
decimal(10,2)
?
but how..
-
timvw
- DevNet Master
- Posts: 4897
- Joined: Mon Jan 19, 2004 11:11 pm
- Location: Leuven, Belgium
Post
by timvw »
phpmyadmin tells me it should be something like:
ALTER TABLE `test` CHANGE `decimal` `decimal` DECIMAL( 10, 2 ) DEFAULT '0' NOT NULL
-
C_Calav
- Forum Contributor
- Posts: 395
- Joined: Wed Jun 02, 2004 10:55 pm
- Location: New Zealand
Post
by C_Calav »
thank you very much