Dear Microsoft,

Why are you changing the rounding behaviour from your MS Office products (MS Excel is 
rounding scientific and not like a bank)?
And why - even if you change that behaviour - are you not supporting the "old" 
rounding engine in a separate or overloaded method somewhere in the great space of the 
.NET galaxy?

Most times when I want to round some doubles, they are not currency values! They are 
needed for some program logic and have to been rounded "scientific" - I would say 
"normal". Do all we programmers really have to implement our own rounding function 
again and again?

Buhuuuu*snivel*
Jochen


-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von gabor
Gesendet: Dienstag, 10. Februar 2004 09:57
An: [EMAIL PROTECTED]
Betreff: Re: AW: [Mono-list] Maths

On Tue, 2004-02-10 at 09:36, Jochen Wezel wrote:
> Well, I hadn't imagined that there are several rounding standards. 
> 
> Here in Germany I only learned to round up each something.5 to the next integer at 
> school.
> Now, I've seen the bank rounding which round up and down. 
> 
> But what I want to do is not bank rounding but scientific rounding: 
> always round up every .5 to the next greater integer. Does anybody 
> know how to do that? System.Math.Round doesn't support any flags to 
> set up the rounding standard :(

hmm, i'm not a dotnet expert, but this is usually solved by adding 0.5 to it and 
truncating it to an integer.
something like:

Convert.ToInt32( x + 0.5) 

maybe?

p.s: pay attention to negative numbers. i'm not sure what behaviour you want for 
negative numbers.

gabor

_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED] 
http://lists.ximian.com/mailman/listinfo/mono-list


_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to