On Tue, 24 Jul 2007 02:29:10 -0700, Desmodromic
<da*******@yahoo.com.auwrote:
>Using db2 CLP I am trying to get the following SQL statement to
display "0.33". But, as you can see, it doesn't.
db2 =select round(float(1) / 3, 2) from sysibm.sysdummy1
1
------------------------
+3.30000000000000E-001
1 record(s) selected.
What on earth am I doing wrong?
Thanks,
\M
What are you doing wrong? You are assuming that ROUND() chops off the
rounded zeros. It does indeed round them, it does not, however, remove
them.
Way around this is as Serge said, cast it afterwards: select
DECIMAL(round(float(1) / 3, 2), 3,2) from sysibm.sysdummy1
B.