473,498 Members | 891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Oracle rounding question


rounding question....

I have this:

1 select cltv

2 from empower.mtgterms

3* where lnkey = '304076'

SQL> /

CLTV

----------

81.1549296
SQL> select round(cltv,2)

2 from empower.mtgterms

3 where lnkey = '304076'

4 /

ROUND(CLTV,2)

-------------

81.15
I need it to round the entire number 81.1549296 to 2 decimal places
which would bring 81.16 (6 rounds the 9 to 0 rounds the 2 to 3 rounds
the 9 to 9 rounds the 4 to 5 rounds the 5 to 6 giving 81.16). I can't
use round(round(cltv,3),2) as I don't know in advance how far
out the decimal precision will be. Is there some oracle function that
can help with this?

--
Posted via http://dbforums.com
Jul 19 '05 #1
2 10175
basic math says round of
81.1549296
says the answer is 81.15
round of 81.155 to 2 decimals would be 81.16
"kboudreau" <me*********@dbforums.com> wrote in message
news:30****************@dbforums.com...

rounding question....

I have this:

1 select cltv

2 from empower.mtgterms

3* where lnkey = '304076'

SQL> /

CLTV

----------

81.1549296
SQL> select round(cltv,2)

2 from empower.mtgterms

3 where lnkey = '304076'

4 /

ROUND(CLTV,2)

-------------

81.15
I need it to round the entire number 81.1549296 to 2 decimal places
which would bring 81.16 (6 rounds the 9 to 0 rounds the 2 to 3 rounds
the 9 to 9 rounds the 4 to 5 rounds the 5 to 6 giving 81.16). I can't
use round(round(cltv,3),2) as I don't know in advance how far
out the decimal precision will be. Is there some oracle function that
can help with this?

--
Posted via http://dbforums.com

Jul 19 '05 #2
SQL> select round(cltv + 0.01, 2) from empower.mtgterms where lnkey =
'304076'

Ivica

"kboudreau" <me*********@dbforums.com> wrote in message
news:30****************@dbforums.com...

rounding question....

I have this:

1 select cltv

2 from empower.mtgterms

3* where lnkey = '304076'

SQL> /

CLTV

----------

81.1549296
SQL> select round(cltv,2)

2 from empower.mtgterms

3 where lnkey = '304076'

4 /

ROUND(CLTV,2)

-------------

81.15
I need it to round the entire number 81.1549296 to 2 decimal places
which would bring 81.16 (6 rounds the 9 to 0 rounds the 2 to 3 rounds
the 9 to 9 rounds the 4 to 5 rounds the 5 to 6 giving 81.16). I can't
use round(round(cltv,3),2) as I don't know in advance how far
out the decimal precision will be. Is there some oracle function that
can help with this?

--
Posted via http://dbforums.com


Jul 19 '05 #3

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

Similar topics

4
7812
by: spebola | last post by:
I am using vb.net 2003 professional and I get the following results when using the round method: dim Amount as decimal = 180.255 Amount = Amount.Round(Amount, 2) Amount now contains 180.25. ...
12
13622
by: 6tc1 | last post by:
Hi all, I just discovered a rounding error that occurs in C#. I'm sure this is an old issue, but it is new to me and resulted in a fair amount of time trying to track down the issue. Basically...
5
2242
by: Jason | last post by:
I am having a rounding problem in a value i am trying to display in VB.NET. If I have the following code: Dim x As Single = 2726.795 Dim y As Single = Math.Round(2726.795, 2) Dim s as String =...
29
3145
by: Marco | last post by:
Hello, I have : float f = 36.09999999; When I do : char cf; sprintf(cf,"%0.03lf", f); I get : 36.100
13
6143
by: Shirsoft | last post by:
I have a 32 bit intel and 64 bit AMD machine. There is a rounding error in the 8th digit. Unfortunately because of the algorithm we use, the errors percolate into higher digits. C++ code is...
10
2146
by: alsmeirelles | last post by:
Hi all, I Have run this test: Private Sub test() Dim d As Double Dim f As Single Dim output As String d = 8888888888888.8887
248
1510
by: md | last post by:
Hi Does any body know, how to round a double value with a specific number of digits after the decimal points? A function like this: RoundMyDouble (double &value, short numberOfPrecisions) ...
20
4955
by: jacob navia | last post by:
Hi "How can I round a number to x decimal places" ? This question keeps appearing. I would propose the following solution #include <float.h> #include <math.h>
2
204
by: kboudreau | last post by:
rounding question.... I have this: 1 select cltv 2 from empower.mtgterms 3* where lnkey = '304076'
0
7124
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,...
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7200
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...
0
7375
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...
1
4904
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...
0
4586
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.