Thank you for the clarification. To force float type in this case I use now:

ROUND(value, 2) + 0.0

Best regards,
Witold

----- Original Message ----- From: "D. Richard Hipp" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Wednesday, February 23, 2005 1:50 PM
Subject: Re: [sqlite] Is it bug?



On Sat, 2005-02-19 at 05:44 -0800, Dan Kennedy wrote:
It has to be text I guess. It can't be a double, as the IEEE format SQLite uses doesn't support rounding to exact numbers of decimal places.


This is correct in general. Most base-10 decimals cannot be represented exactly in IEEE floats. For example, the value 1.23 cannot be expressed as a 64-bit float. If you try, the machine will used the closest value it can store which is:

  1.229999999999999982236431605997495353221893310546875

On the other hand, if the second argument to the round()
function is zero (or is omitted) then the result will be
an integer.  And I wonder if it doesn't make sense in that
case to return an integer value?
--
D. Richard Hipp <[EMAIL PROTECTED]>


Reply via email to