473,561 Members | 3,803 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying a float8 as a full-length number

Hello,

I need to get a float8 to display as a number

db=# SELECT CAST('0.00001' AS float8);
float8
--------
1e-05
(1 row)
I need this to return 0.00001 instead. I know about the to_char
function, but this seems to truncate the number after fourteen digits of
precision:
db=# SELECT CAST('0.0000000 00000001' AS float8);
float8
--------
1e-15
(1 row)

db=# SELECT to_char(CAST('0 .00000000000000 1' AS float8),
CAST('0.9999999 999999999999999 999' AS text));
to_char
-------------------
0.0000000000000 0
(1 row)
Does anyone have any suggestions?

Thanks,
Grant
--
Grant Rutherford
Iders Incorporated
600A Clifton Street
Winnipeg, MB
R3G 2X6
http://www.iders.ca
tel: 204-779-5400 ext 36
fax: 204-779-5444
=============== =============== ==
Iders Incorporated: Confidential
=============== =============== ==
Note: This message is intended solely for the use of the designated
recipient(s) and their appointed delegates, and may contain
confidential information. Any unauthorized disclosure, copying or
distribution of its contents is strictly prohibited. If you have
received this message in error, please destroy it and advise the sender
immediately by phone, Email or facsimile.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #1
3 2504
Grant,

Cast it to numeric instead of float8.
SELECT CAST('0.00001' AS numeric);

Julie

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 12 '05 #2
On Wed, Oct 08, 2003 at 12:48:09 -0500,
Grant Rutherford <gr*********@id ers.ca> wrote:

I need this to return 0.00001 instead. I know about the to_char
function, but this seems to truncate the number after fourteen digits of
precision:


How about casting it to numeric? It seemed to work reasonably for me,
but I only tried one case.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #3
Julie May wrote:
Grant,

Cast it to numeric instead of float8.
SELECT CAST('0.00001' AS numeric);

Julie

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Thanks, that worked perfectly.

--
Grant Rutherford
Iders Incorporated
600A Clifton Street
Winnipeg, MB
R3G 2X6
http://www.iders.ca
tel: 204-779-5400 ext 36
fax: 204-779-5444
=============== =============== ==
Iders Incorporated: Confidential
=============== =============== ==
Note: This message is intended solely for the use of the designated
recipient(s) and their appointed delegates, and may contain
confidential information. Any unauthorized disclosure, copying or
distribution of its contents is strictly prohibited. If you have
received this message in error, please destroy it and advise the sender
immediately by phone, Email or facsimile.


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1768
by: shaun | last post by:
When asp.net pages are made in vs.net, loading on the local host displays the labels all in the top left corner of the screen. Also, all textboxes and image buttons are not even displayed at all. If pages are made on a remote server, they load perfetly fine, it is just the local host displaying them incorrectly. Is this a common problem?? I...
3
5737
by: Mark C | last post by:
When aspx pages are made in vs.net, loading on the local host displays the labels all in the top left corner of the screen. Also, all textboxes and image buttons are not even displayed at all. If pages are made on a remote server, they load perfetly fine, it is just the local host displaying them incorrectly. Is this a common problem?? I...
3
1958
by: Pat Sheen | last post by:
Is there some setting in Access so when I get help it will display full screen and not part screen with my Access window. I've Googled and checked help but can't find anything. Thanks Pat
8
3289
by: Jon Weston | last post by:
I'm setting up an Access2003 database with pictures. I put a bound ole picture ctrl on a form that's source is the table that contains the pictures and follow ALL the directions for embedding a picture. The ctrl in the form only displays the filename of the picture. The underlying table, when opened in table view, shows the word "package"...
3
1217
by: Milkstr | last post by:
I have a database of football players names, their names appear more than once if the table, i.e a players name might be there 10 times, the initial name is just a short version for ease, i then have a second field with their full name, but this only appears once, I want to do a sum of all their goals scored but display their full name that...
4
1533
by: Blue10 | last post by:
Hi, I would like to be able to display thumbnail versions of the full images on my website. Currently I have to make the thumbnails manually so I wonder if there is any way of displaying reduced size and resolution version of the original images in a webpage automatically? I believe autotrader do this on http://www.autotrader.co.uk (I could be...
1
5328
by: gouse | last post by:
Hi Friends, when I have convert the float4 data type to float8 data type it was lossing the value. The following are the commands i Have used. Plaese go through it. (1) TE TABLE tab1(id int PRIMARY KEY,val float4); (2) INSERT INTO tab1 VALUES(1,1.1); INSERT INTO tab1 VALUES(2,1.2); INSERT INTO tab1 VALUES(3,1.3);
1
5955
by: hbkiwi | last post by:
Hi, Just playing with Access fairly new to it (like days old). Also it's my first post here so if I'm in the wrong place, sorry.. What I'm wanting to know is basically I have lets call it Table Data and I've got Last Name, First Name in the columns. I than have Table Full Name, with column Full Name. I have a relationship between the primary...
11
9762
by: Usenet User | last post by:
..NET 1.1/2.0 I have a need to display high-resolution scrollable images in a .NET application (Windows Forms). One well known solution is to create a Panel with AutoScroll set to "true" and then add a PictureBox or another Panel to it, that is used to display the image. The above approach works, however, to my surprise, .NET GDI+-based...
7
6640
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a tabcontainer which has 1 panel already, however I want to try create the TabPanels dynamically. I followed the advice here: ...
0
7647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8088
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7618
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7930
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5472
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5187
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3617
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3600
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.