Decimal Length Values

dynamo's Avatar, Join Date: Aug 2007
Newbie Member
Currently my Decimal length values are set to (15,2)

my figures are showing up as 1000.00

how can i add a comma so it looks like 1,000.00

also when im putting figures in Asc or Desc order its showing figures like 800.00 as higher than 1000.00

would the comma be the solution to this?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I don't think comma would solve the issue of 800 greater than 1000.
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
Commas wont solve the issue! Please post the query you are using, and the version of RDBMS!
0
jwshepherd's Avatar, Join Date: Aug 2007
Team Leader
Database sorting is very limited without extended query options. Otherwise it is very basic character by character. 1 is lower than 8
0
Windhan's Avatar, Join Date: Jan 2008
Go4Expert Member
Quote:
Originally Posted by dynamo
Currently my Decimal length values are set to (15,2)

my figures are showing up as 1000.00

how can i add a comma so it looks like 1,000.00

also when im putting figures in Asc or Desc order its showing figures like 800.00 as higher than 1000.00

would the comma be the solution to this?
Code:
mysql> CREATE TABLE test_deci(id INTEGER NOT NULL PRIMARY KEY,val DECIMAL(10,2));
Query OK, 0 rows affected (0.31 sec)

Code:
mysql> INSERT INTO test_deci VALUES (1,100.00),(2,200.00),(3,300.00),(4,400.00),(5,500.00);
Query OK, 5 rows affected (0.00 sec)
Records: 5 Duplicates: 0 Warnings: 0

Code:
mysql> SELECT * FROM test_deci ORDER BY val ASC;
+----+--------+
| id | val    |
+----+--------+
|  1 | 100.00 |
|  2 | 200.00 |
|  3 | 300.00 |
|  4 | 400.00 |
|  5 | 500.00 |
+----+--------+
5 rows in set (0.00 sec)
Code:
mysql> SELECT * FROM test_deci ORDER BY val DESC;
+----+--------+
| id | val    |
+----+--------+
|  5 | 500.00 |
|  4 | 400.00 |
|  3 | 300.00 |
|  2 | 200.00 |
|  1 | 100.00 |
+----+--------+
5 rows in set (0.00 sec)
Works fine for me !!!!!!!1
0
jrl.dharshana's Avatar, Join Date: Jun 2009
Newbie Member
usefull ................thaks you very mech...Sir