Hi,
If you want to round your value to the specified no. of digits, use round().
Else if you want to extract the values without rounding use truncate().
mysql > select round(blustat,2) from parts; [the value will get rounded to
the nearest decimal]
or
mysql > select truncate (blustat,2) from parts; [no rounding, simply
extract only the value of specified digits]
For More info:http://www.keithjbrown.co.uk/vworks/mysql/mysql_p9.php
Thanks,
ViSolve DB Team
----- Original Message -----
From: "Dimitar Vasilev" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Thursday, February 01, 2007 1:40 AM
Subject: rounding digits after decimal sign
Hello,
Can anyone point me to a section of manual or link how to reduce digits
after
a decimal sign?
I have a table
mysql> desc part;
+---------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+--------------+------+-----+---------+-------+
| kod | varchar(255) | YES | | NULL | |
| bulstat | double(15,5) | YES | MUL | NULL | |
| Land | varchar(3) | YES | MUL | NULL | |
| ID | varchar(15) | YES | MUL | NULL | |
| IME | varchar(100) | YES | MUL | NULL | |
| VALUE | double(15,5) | YES | | NULL | |
| CNT | smallint(5) | YES | | NULL | |
| Date | datetime | YES | | NULL | |
+---------+--------------+------+-----+---------+-------+
and in bulstat column i have digits like 831690750.00000
which i would like round to the last whole digit.
Also could someone give a hint how to recode digits in order to anonymize
data.
My end goal is to export the dataset into a social network software for my
thesis.
Thanks,
--
Димитър Василев
Dimitar Vassilev
GnuPG key ID: 0x4B8DB525
Keyserver: pgp.mit.edu
Key fingerprint: D88A 3B92 DED5 917E 341E D62F 8C51 5FC4 4B8D B525
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]