473,396 Members | 2,111 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,396 software developers and data experts.

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 10174
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
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
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
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
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
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
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
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
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
by: kboudreau | last post by:
rounding question.... I have this: 1 select cltv 2 from empower.mtgterms 3* where lnkey = '304076'
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.