Last post Feb 01, 2015 02:48 AM by Careed
Feb 01, 2015 01:32 AM|mdehghani|LINK
can we limit the float data type to this format: "0.00" in the database?
Feb 01, 2015 02:21 AM|Careed|LINK
A floating point is based on its size: a float (Single) has up to seven decimal digits of precision while a double (Double) has fifteen decimal digits of precision. The data in your database will reflect that.
Now, maybe your question is really: Can I display my float data type as "0.00" when there is less than two significant decimal digits and then only show two decimal digits otherwise?
Feb 01, 2015 02:26 AM|mdehghani|LINK
I want 33.3333320617676 to be stored as 33.33
Feb 01, 2015 02:48 AM|Careed|LINK
It cannot be stored as a float. You would need to store it as a decimal(15, 2), but this would be a fixed-point number.