Database double type data, how do you save all the integers? __ Database

Source: Internet
Author: User

There is a scoring system in which the score can be entered in 5.6 decimal places, but the data stored is rounded after the integer 6.

I use the update data to execute and directly manipulate the database to change the data, this is the case. Also changed the entity to the precision set precision= "8" scale= "2" is no matter.

Later, in Baidu to see

The number of significant digits in the c#double (that is, whether the integer or fractional digits add up) is 15 bits
Float represents up to 7 bits of valid data. Double represents up to 16 digits of valid data.
Think of the number of bits set by the database, the original database set the number of digits is 50
I changed the number of digits of double type to 0, just fine.
Later, Baidu came out of the reason: the use of the Navicat client, which has a "decimal", the Double (11,0) changed to double (11,3), sure enough, can insert a decimal, and retained three decimal, and "decimal" option on the written 3.

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.