| | |
Decimal problem
Thread Solved |
•
•
Join Date: Apr 2008
Posts: 583
Reputation:
Solved Threads: 0
Hi,
100,000,000.00 is stored as 100.00 in decimal (14,2).
I don't know what is wrong?
Thanks
MySQL Syntax (Toggle Plain Text)
INSERT INTO money (salary) VALUES ('100,000,000.00')
100,000,000.00 is stored as 100.00 in decimal (14,2).
I don't know what is wrong?
Thanks
•
•
•
•
Hi,
MySQL Syntax (Toggle Plain Text)
INSERT INTO money (salary) VALUES ('100,000,000.00')
100,000,000.00 is stored as 100.00 in decimal (14,2).
I don't know what is wrong?
Thanks
mysql suypports multiple data schema, language-specific and region specific
in many supported schema the comma is a decimal separator, the number is truncated 2 digits after the first valid decimal separator = 100.00
database code is meant to be machine readable, not human readable, so dont try to make it pretty in the database
do any formatting only on output.
number should be 100000000.00.
input validation should strip out any incorrect characters in the input data, and return to the input form for re-entry with a "did you mean" prompt (like google when you mis-spell)
without validation the database wont last very long till it falls over dead
(Likewise repair dates that these salaries refer to, store timestamps not text strings, for the same reasons)
Last edited by almostbob; Mar 5th, 2009 at 9:47 am.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
![]() |
Similar Threads
- reversing number problem. (C)
- binary to decimal problem (C++)
- Hi Everyone, Have a C++ Problem. (C++)
- Math/computerscience Log Problem- Helpppp (Computer Science)
- Decimal Problem In C (C)
- decimal counting of a double... howto? (Java)
Other Threads in the MySQL Forum
- Previous Thread: Joe 'Zonker' Brockmeier Fights FOSS License FUD
- Next Thread: MYSQL Replace Help
Views: 951 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for MySQL
"use" .db 1 ajax alphabet amazon aws camparingtocolumns cascade cast code convert count count(col) data database delete design distinct ec2 eliminate enter error form generator html images innerjoins insert join keyword keywords matchingcolumns multiple multipletables mysql mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch noob number open operand oracle order parse pdf php print query recursive relationaldatabases relationship relationships remove reorderingcolumns resultset retrieve script search select simpledb sort sql statement string syntax table tree type-conversion update values welsh






