×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

getting garbage when inserting value in column type double

getting garbage when inserting value in column type double

getting garbage when inserting value in column type double

(OP)
hi, I am creating a table with column rate type double
then i inserted value into that table, and the result that came out from
that query was garbage. Not the one I inserted.
Can any one help me. Here is my code

mysql>create table roman(type double(16,4));

mysql> insert  into roman values(16.4);
Query OK, 1 row affected (0.02 sec)

mysql> select * from roman ;
+-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------------------+
¦ rate

                                  ¦
+-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------------------+
¦ 190359826455422719014202781144712880322016387120297010110046519028527894956257
32743213763196815586366749275297927955172219667069187668495131196738368218736857
6768372755275862566106038272.0000 ¦
+-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------------------+
1 row in set (0.00 sec)  

// this is the result that came out, but it should be 16.4.
//can someone helpme thank's alot
//my email: roman987@aol.com

RE: getting garbage when inserting value in column type double

Hi roman987,
   MySQL does not accept precision specifications for data
type REAL and DOUBLE.
Instead use DECIMAL(16,4)

Cheers

Ken
admin@mysqlwebring.com
MySQL Webring

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close