469,590 Members | 2,498 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,590 developers. It's quick & easy.

How do I format a DOUBLE?

Hi all,

We're using UDF 8.2.

How does one format a DOUBLE to, for example, 2 decimal digits? Sort of
like sprintf in C where you'd give a format pattern such as 4.2F . I
cannot find any formatting built-in functions. Using CHAR(my_double)
results in the number being presented in exponential form; DIGITS does
not work for DOUBLEs...

Thanks,

Alejandrina

Jun 30 '06 #1
1 4644
apattin wrote:
Hi all,

We're using UDF 8.2.

How does one format a DOUBLE to, for example, 2 decimal digits? Sort of
like sprintf in C where you'd give a format pattern such as 4.2F . I
cannot find any formatting built-in functions. Using CHAR(my_double)
results in the number being presented in exponential form; DIGITS does
not work for DOUBLEs...

I would cast it to DECIMAL

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Jun 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by J | last post: by
11 posts views Thread by Nathan Wiegman | last post: by
2 posts views Thread by Bob | last post: by
5 posts views Thread by Carrie | last post: by
8 posts views Thread by Jayesh | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.