. Decimal .net can be different types of data under the hood.
.net formats MySQL ---------------------------------------------------- Decimal(Double) Float Decimal(Int32) DECIMAL Decimal(Int32()) DECIMAL Decimal(Int64) DECIMAL Decimal(Single) DECIMAL Decimal(UInt32) DECIMAL Decimal(UInt64) DECIMAL Decimal(Int32, Int32, Int32, Boolean, Byte) DECIMAL
Attention
Please note that, according to John Skeet, decimal
can be declared in many ways, but there will always be FLOAT
under the hood, while all rounding errors bring, you were warned.
See the decimal equivalent of SQL in .NET
MySQL decimal
takes up more space if you give it greater precision.
From the manual: http://dev.mysql.com/doc/refman/5.5/en/precision-math-decimal-changes.html
Values ββfor DECIMAL columns in MySQL 5.5 are stored using a binary format that packs nine decimal digits into 4 bytes.
The maximum number of digits is 65 divided by 9 = 8 bytes, INT128.
Johan source share