Hello all.
I like to hear if there is anyone that can help me, I need to store values with up to 4 decimals. ( example: 0.0098 or 0.9831 )
I am trying to do some big calculation and need the values to be exact like I type them in.
Please let me know if you can help me out.
Best regards
Wizzuriz.
Decimals in Mysql
-
- Posts: 534
- Joined: Thu May 05, 2011 8:19 pm
Re: Please help me. Decimals in Mysql
In the values area, when you set the length (assuming your using phpMyAdmin) then you add it like so:
2,4 to allow up to -99.9999 - 99.9999
If doing it with SQL code then use this:
2,4 to allow up to -99.9999 - 99.9999
If doing it with SQL code then use this:
field_name DECIMAL(2,4)
I don't like to brag, but I wasn't circumcised. I was circumnavigated.
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
Re: Decimals in Mysql
CREATE TABLE `testbase`.`testtable` ( `id` INT NOT NULL , field_name DECIMAL(2,4) `male` INT NOT NULL ) ENGINE = MYISAM ;Can you please show me a query where you type in the field_name.
Thanks for the help mann,
Best regards
Wizzuriz
Last edited by jacek on Mon Aug 15, 2011 11:21 pm, edited 1 time in total.
Reason: code tags...
Reason: code tags...
-
- Posts: 534
- Joined: Thu May 05, 2011 8:19 pm
Re: Decimals in Mysql
Fixed it in the quotewizzuriz wrote:CREATE TABLE `testbase`.`testtable` ( `id` INT NOT NULL , `field_name` DECIMAL(2,4), `male` INT NOT NULL ) ENGINE = MYISAM ;Can you please show me a query where you type in the field_name.
Thanks for the help mann,
Best regards
Wizzuriz
I don't like to brag, but I wasn't circumcised. I was circumnavigated.
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9