dbTalk Databases Forums  

Rounding

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Rounding in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mike morse
 
Posts: n/a

Default Rounding - 10-09-2003 , 10:29 AM






How do you round numbers up.. I just see rounding off the
decimal places. Can you round to maybe the nearest
hundreth?

-mike

Reply With Quote
  #2  
Old   
Matt Carroll [MS]
 
Posts: n/a

Default Re: Rounding - 10-09-2003 , 02:14 PM






You can use the VBA Round function to round to the nearest 100th.
E.g.
WITH MEMBER measures.Foo as 'Round(1.23456789, 2)'
select {measures.Foo} on 0
from sales

Excel also has rounding functions available which may be of interet such as
Floor and Ceiling.
E.g.
WITH MEMBER measures.Foo as 'Excel!Ceiling(1.23456789, .01)'
select {measures.Foo} on 0
from sales

- Matt Carroll
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"mike morse" <mike.morse (AT) micromo (DOT) com> wrote

Quote:
How do you round numbers up.. I just see rounding off the
decimal places. Can you round to maybe the nearest
hundreth?

-mike



Reply With Quote
  #3  
Old   
Michael Morse
 
Posts: n/a

Default Re: Rounding - 10-10-2003 , 07:37 AM



Matt,
Sorry about the confusion. I meant Round to the nearest
hundred, or possibly thousand.

mike


Quote:
-----Original Message-----
You can use the VBA Round function to round to the
nearest 100th.
E.g.
WITH MEMBER measures.Foo as 'Round(1.23456789, 2)'
select {measures.Foo} on 0
from sales

Excel also has rounding functions available which may be
of interet such as
Floor and Ceiling.
E.g.
WITH MEMBER measures.Foo as 'Excel!Ceiling
(1.23456789, .01)'
select {measures.Foo} on 0
from sales

- Matt Carroll
--
This posting is provided "AS IS" with no warranties, and
confers no rights.

"mike morse" <mike.morse (AT) micromo (DOT) com> wrote in message
news:003f01c38e7a$31bc3c80$a301280a (AT) phx (DOT) gbl...
How do you round numbers up.. I just see rounding off
the
decimal places. Can you round to maybe the nearest
hundreth?

-mike


.


Reply With Quote
  #4  
Old   
Bill Cheng [MSFT]
 
Posts: n/a

Default Re: Rounding - 10-13-2003 , 07:50 AM



Hi Michael,

To round to the nearest hundred, we can try to first divide the number by
100, round it and multiple the result by 100,

e.g. 100 * ROUND(123.3436/100)

The Round function is as follows:
Round(expression[, numdecimalplaces])

numdecimalplaces
Optional. Number indicating how many places to the right of the decimal are
included in the rounding. If omitted, integers are returned by the Round
function.


Bill Cheng
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
Quote:
Content-Class: urn:content-classes:message
From: "Michael Morse" <mike.morse (AT) micromo (DOT) com
Sender: "Michael Morse" <mike.morse (AT) micromo (DOT) com
References: <003f01c38e7a$31bc3c80$a301280a (AT) phx (DOT) gbl
O4i5KmpjDHA.2512 (AT) TK2MSFTNGP09 (DOT) phx.gbl
Subject: Re: Rounding
Date: Fri, 10 Oct 2003 05:37:47 -0700
Lines: 41
Message-ID: <0dfc01c38f2b$4f8f6870$a101280a (AT) phx (DOT) gbl
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcOPK0+PWWsTN9mDRraXvs8vUSmtQw==
Newsgroups: microsoft.public.sqlserver.olap
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.olap:43710
NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.public.sqlserver.olap

Matt,
Sorry about the confusion. I meant Round to the nearest
hundred, or possibly thousand.

mike


-----Original Message-----
You can use the VBA Round function to round to the
nearest 100th.
E.g.
WITH MEMBER measures.Foo as 'Round(1.23456789, 2)'
select {measures.Foo} on 0
from sales

Excel also has rounding functions available which may be
of interet such as
Floor and Ceiling.
E.g.
WITH MEMBER measures.Foo as 'Excel!Ceiling
(1.23456789, .01)'
select {measures.Foo} on 0
from sales

- Matt Carroll
--
This posting is provided "AS IS" with no warranties, and
confers no rights.

"mike morse" <mike.morse (AT) micromo (DOT) com> wrote in message
news:003f01c38e7a$31bc3c80$a301280a (AT) phx (DOT) gbl...
How do you round numbers up.. I just see rounding off
the
decimal places. Can you round to maybe the nearest
hundreth?

-mike


.




Reply With Quote
  #5  
Old   
Matt Carroll [MS]
 
Posts: n/a

Default Re: Rounding - 10-13-2003 , 11:50 AM



The VBA Round function takes a second argument that indicates how many
decimal places after the decimal you want. My first example will round to
the nearest 100th.

- Matt Carroll
--
This posting is provided "AS IS" with no warranties, and confers no rights.

""Bill Cheng [MSFT]"" <billchng (AT) online (DOT) microsoft.com> wrote

Quote:
Hi Michael,

To round to the nearest hundred, we can try to first divide the number by
100, round it and multiple the result by 100,

e.g. 100 * ROUND(123.3436/100)

The Round function is as follows:
Round(expression[, numdecimalplaces])

numdecimalplaces
Optional. Number indicating how many places to the right of the decimal
are
included in the rounding. If omitted, integers are returned by the Round
function.


Bill Cheng
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "Michael Morse" <mike.morse (AT) micromo (DOT) com
| Sender: "Michael Morse" <mike.morse (AT) micromo (DOT) com
| References: <003f01c38e7a$31bc3c80$a301280a (AT) phx (DOT) gbl
O4i5KmpjDHA.2512 (AT) TK2MSFTNGP09 (DOT) phx.gbl
| Subject: Re: Rounding
| Date: Fri, 10 Oct 2003 05:37:47 -0700
| Lines: 41
| Message-ID: <0dfc01c38f2b$4f8f6870$a101280a (AT) phx (DOT) gbl
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcOPK0+PWWsTN9mDRraXvs8vUSmtQw==
| Newsgroups: microsoft.public.sqlserver.olap
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.olap:43710
| NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
| X-Tomcat-NG: microsoft.public.sqlserver.olap
|
| Matt,
| Sorry about the confusion. I meant Round to the nearest
| hundred, or possibly thousand.
|
| mike
|
|
| >-----Original Message-----
| >You can use the VBA Round function to round to the
| nearest 100th.
| >E.g.
| >WITH MEMBER measures.Foo as 'Round(1.23456789, 2)'
| >select {measures.Foo} on 0
| >from sales
|
| >Excel also has rounding functions available which may be
| of interet such as
| >Floor and Ceiling.
| >E.g.
| >WITH MEMBER measures.Foo as 'Excel!Ceiling
| (1.23456789, .01)'
| >select {measures.Foo} on 0
| >from sales
|
| >- Matt Carroll
| >--
| >This posting is provided "AS IS" with no warranties, and
| confers no rights.
|
| >"mike morse" <mike.morse (AT) micromo (DOT) com> wrote in message
| >news:003f01c38e7a$31bc3c80$a301280a (AT) phx (DOT) gbl...
| >> How do you round numbers up.. I just see rounding off
| the
| >> decimal places. Can you round to maybe the nearest
| >> hundreth?
|
| >> -mike
|
|
| >.
|
|




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.