No announcements

### Math.Round() problem - inconsistent result

"Could someone let me know the algorithm it uses to compute the rounding?" Math.Round(x, 2) is the same as Math.Round(x * 100.0) / ...
| 1 Replies | 1393 Views | Created by Kumar K S - Monday, April 15, 2013 9:39 AM | Last reply by Mike Danes - Monday, April 15, 2013 10:10 AM

### Math.Round - Inconsistent rounding with float/double

Hi, I am seeing inconsistent rounding when using a double.  I checked and float does the same thing.  I have not seen these results from a Decimal.  I saw that floats ...
| 3 Replies | 5123 Views | Created by Adeptive.Steve - Friday, February 18, 2011 5:54 PM | Last reply by Masudur - Tuesday, February 22, 2011 7:22 AM

### Possible Bug: Math.Round returning inconsistent results

value to print. And then it goes on not using the correct value. That is weird. WriteLine() simply calls Object.ToString(), which in turn ultimately results
| 5 Replies | 3826 Views | Created by Ralf_from_Europe - Friday, January 8, 2010 11:23 PM | Last reply by Marcel Roma - Tuesday, January 12, 2010 9:43 AM

### Math.Round() Problem

if (delta >= 4.999 && delta
| 4 Replies | 4206 Views | Created by XXChester - Tuesday, October 23, 2007 11:27 PM | Last reply by Joe McKavanagh - Wednesday, October 24, 2007 7:47 AM

### Problem when using Math.Round() ?

Hi everyone, I used Math.Round as below codes: float result = 0; result = ...
| 4 Replies | 823 Views | Created by Taibc - Sunday, April 28, 2013 2:49 AM | Last reply by Taibc - Thursday, May 2, 2013 12:31 AM

### Math.Round Problem

, and it is not really rounding, you are trying to define a ceiling function of sorts. Off hand: int number = 63; int rem = 0; int res = ...
| 9 Replies | 3774 Views | Created by srimal_s - Wednesday, June 18, 2008 3:46 AM | Last reply by Burt2 - Saturday, July 26, 2014 10:26 PM

### An inconsistent result

Thank you NaochanON, after reading the Wiki my understanding is greatly enhanced.  Thank you Airwaves, my main problem was with the inconsistency, which the ...
| 4 Replies | 3307 Views | Created by Kiwi Bert - Saturday, October 15, 2011 5:34 AM | Last reply by Kiwi Bert - Monday, October 17, 2011 3:53 AM

### Math.Round

I want to achieve Math.Round upwards after 2 decimal. So if the number is 23.231 the it should be rounded to 23.24 and not 23.23 which regular Math.Round ...
| 4 Replies | 2818 Views | Created by testcode007 - Thursday, March 25, 2010 10:23 PM | Last reply by testcode007 - Thursday, March 25, 2010 11:07 PM

### Math.Round

Here's a better midpoint rounding function that won't have the same compound rounding problem as I showed in my other example. Public Function Round2
| 7 Replies | 1873 Views | Created by fsze88ATmeDOTcom - Monday, December 3, 2012 8:51 AM | Last reply by Paul Ishak - Tuesday, December 4, 2012 12:42 AM

### Inconsistent results?

Hi, I've noticed that fxcopcmd (and the UI also) can yield inconsistent analysis results. This is a bit of a problem, because we've started to integrate ...
| 4 Replies | 4550 Views | Created by Martin Maierhofer - Thursday, May 11, 2006 4:30 PM | Last reply by Martin Maierhofer - Tuesday, May 16, 2006 9:15 AM

### Math.Round produces different results depending on where it is run

I have the following line of code that is producing 2 different results.   Given the following line var rounded = Math.Round(415 *0.01f, ...
| 1 Replies | 382 Views | Created by jerryhatok0028 - Friday, July 31, 2015 1:35 AM | Last reply by André Renato Furtado - Friday, July 31, 2015 2:11 AM

### Math.round BUG

Try this:   alert( Math.round(-1.245*100) ); //shows -125 alert( Math.round(-2.245*100) ); //shows -224
| 0 Replies | 4875 Views | Created by Mircea S123 - Monday, September 29, 2008 3:49 PM

### Math.Round()

You question is not clear whether you want to fix it to 2 decimals when there are more Dim num1 as string = "16.7645" Dim PString As String = Math.Round
| 5 Replies | 3405 Views | Created by Mansi Shah - Saturday, May 2, 2009 8:00 AM | Last reply by Arjun Paudel - Saturday, May 2, 2009 10:24 AM

### Math.Round and MidpointRounding.AwayFromZero

MidpointRounding.AwayFromZero to fix my problem but it is not ...
| 3 Replies | 4383 Views | Created by Francis_L - Wednesday, January 25, 2012 8:50 PM | Last reply by Yann Duran - Friday, January 27, 2012 9:05 AM

### Math.Round Issue

As per JohnWein said, we can use MidpointRounding enumeration to get the next higher value whenever round the middle value. Math.Round(1.5
| 3 Replies | 3336 Views | Created by Sobin - Thursday, February 11, 2010 12:18 PM | Last reply by Shantha Kumar T - Friday, February 12, 2010 4:47 AM

### Inconsistent results

CU7 does NOT resolve this problem. It seems as if the problem is a combination with calculated members and many simultaneous queries executing in many threads at ...
| 2 Replies | 4237 Views | Created by Filip Bonnevier - Monday, May 5, 2008 1:53 PM | Last reply by Filip Bonnevier - Friday, May 23, 2008 8:34 AM

### C# Math.Round() vs SQL Server Math.Round()

Hi kgper, Use the .toString(NoOfDecimalPlaces) to fix your issue. .toString() will give the similar result of Math.Round() in ...
| 2 Replies | 2419 Views | Created by kgper - Monday, August 20, 2012 3:21 AM | Last reply by kgper - Monday, August 20, 2012 4:42 AM

### Inconsistent results

Thanks Trevor I think the Drive By Wire problem is a bluetooth issue, it was late and I was tired when I initially experienced it (I got sucked in) - I'll do some more ...
| 3 Replies | 4775 Views | Created by integer99 - Tuesday, November 11, 2008 11:00 PM | Last reply by Trevor Taylor - Thursday, November 13, 2008 1:26 AM