473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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 4892
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: J | last post by:
Would anyone know if there a type tag to format a double? I have f for floating point, but cannot find one for double.
5
by: google | last post by:
first, a little background... i have a C program which preprocesses some data, and then outputs the results into a text file. that text file, in turn, is used as input to a FORTRAN...
3
by: Boz | last post by:
Hi, I am trying to use string.Format() to output the value of a double. double da = 100000000000.99994; double db = 100000000000.9994; double dc = 100000000000.994; double dd =...
11
by: Nathan Wiegman | last post by:
Hi, Anyone know why "s" equals "0.0870000000000000000000" after the following lines execute? Thanks, Nate double d = 0.087000000000000008; string s = string.Format("{0:f22}", d);
2
by: Bob | last post by:
I'm having trouble the string.Format() throwing exceptions and I can't figure out what I am doing wrong. Given the following setup code: string str = { "one", "two", "three", "four" }; double...
5
by: Carrie | last post by:
Good Morning, I have a combobox whose list is bound to DataSet1.Sales Growth Options.Sales Growth. The data is double and I would like it displayed as a percentage. I have tried two things: ...
8
by: Jayesh | last post by:
Hi, How is a double value stored in 8 bytes ? Or what is the format ? How is it different from __int64 ? How is __int64 stored in 8 bytes. Please do reply. regards, Jayesh
1
by: desi.american | last post by:
I have a dynamically generates ASPX page with tables and data. Depending on user selection, the same page can be viewed as a simple web page (rendered in HTML) or as an excel spreadsheet. If the...
5
by: ChinChin | last post by:
Hi, I have made a window application that get file information from the server the file size return in bytes. I need help on how to format the file size accordingly so that it will return the file...
1
by: differentsri | last post by:
THIS IS AN ASP.NET 1.1 APPLICATION IAM TRYING TO UPDATE THE FIELD BUT I AM NOT ABLE TO UPDATE IT? CAN U TELL THE REASON ? IT IS GIVING THE FOLLOWING ERROR BELOW I HAVE ALSO GIVEN THE CODE OF...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.