How does mysqlfloat save decimals? Solution

Source: Internet
Author: User
How does mysqlfloat save decimals? I set a field type to float, but insert decimals and save them to the database as integers. on the Internet, I changed float to float (5, 2) the two decimal places can be saved. there are no more than five digits. where are the five or two digits set, if I change the length to, an error is returned. ------ solution ------------------ cannot I change the length of phpmyamin? --- How does mysql float save decimals?
I set a field type to float, but insert decimals and save them to the database as integers.
I can change float to float (5, 2) on the Internet to save two decimal places with no more than five digits,
Where can I set the number 5 or 2? I changed the length to 5 or 2, and an error is returned.

------ Solution --------------------
Can I change the length of phpmyamin?
------ Solution --------------------
Create table test (float_column float (5, 2) not null default 0 );
No error is reported. For mysql 5.1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.