Click here to Skip to main content
15,888,521 members
Home / Discussions / C#
   

C#

 
AnswerRe: SQL View Class in C# .Net Pin
leppie11-Jun-08 20:40
leppie11-Jun-08 20:40 
QuestionOne Process for more processors on more server? Pin
softwarejaeger11-Jun-08 20:09
softwarejaeger11-Jun-08 20:09 
AnswerRe: One Process for more processors on more server? Pin
leppie11-Jun-08 20:42
leppie11-Jun-08 20:42 
GeneralRe: One Process for more processors on more server? Pin
softwarejaeger11-Jun-08 21:17
softwarejaeger11-Jun-08 21:17 
GeneralRe: One Process for more processors on more server? Pin
Ashfield11-Jun-08 22:10
Ashfield11-Jun-08 22:10 
Question.Net application in Vista platform, CAS !!!!!???? Pin
Abdul Gafoor11-Jun-08 20:00
Abdul Gafoor11-Jun-08 20:00 
AnswerRe: .Net application in Vista platform, CAS !!!!!???? Pin
stancrm11-Jun-08 20:08
stancrm11-Jun-08 20:08 
Questionstrange decimal rounding Pin
George_George11-Jun-08 19:23
George_George11-Jun-08 19:23 
Hello everyone,


As mentioned here,

http://msdn.microsoft.com/en-us/library/system.decimal(VS.80).aspx

"Conversions from Decimal to other types are narrowing conversions that round the Decimal value to the nearest integer value toward zero."

It conflicts my previous understanding that in all rounding in C#, we round to the nearest integer. Here is my test code. How strange it is, right?

using System;

class Test
{
    static void Main()
    {
        Decimal b = 100.9M;
        int a = (int)b;

        // output 100, other than 101
        Console.WriteLine(a);

        return;
    }
}



thanks in advance,
George
AnswerRe: strange decimal rounding Pin
Christian Graus11-Jun-08 19:45
protectorChristian Graus11-Jun-08 19:45 
GeneralRe: strange decimal rounding Pin
George_George11-Jun-08 19:53
George_George11-Jun-08 19:53 
AnswerRe: strange decimal rounding Pin
Zoltan Balazs11-Jun-08 22:13
Zoltan Balazs11-Jun-08 22:13 
GeneralRe: strange decimal rounding Pin
George_George12-Jun-08 23:24
George_George12-Jun-08 23:24 
AnswerRe: strange decimal rounding Pin
S. Senthil Kumar12-Jun-08 21:07
S. Senthil Kumar12-Jun-08 21:07 
GeneralRe: strange decimal rounding Pin
George_George12-Jun-08 23:23
George_George12-Jun-08 23:23 
AnswerRe: strange decimal rounding Pin
S. Senthil Kumar13-Jun-08 1:24
S. Senthil Kumar13-Jun-08 1:24 
GeneralRe: strange decimal rounding Pin
George_George15-Jun-08 3:52
George_George15-Jun-08 3:52 
GeneralRe: strange decimal rounding Pin
S. Senthil Kumar15-Jun-08 11:03
S. Senthil Kumar15-Jun-08 11:03 
GeneralRe: strange decimal rounding Pin
George_George15-Jun-08 14:48
George_George15-Jun-08 14:48 
GeneralRe: strange decimal rounding Pin
S. Senthil Kumar15-Jun-08 18:09
S. Senthil Kumar15-Jun-08 18:09 
GeneralRe: strange decimal rounding Pin
George_George15-Jun-08 18:49
George_George15-Jun-08 18:49 
QuestionWhite Board Pin
Usharva11-Jun-08 19:22
Usharva11-Jun-08 19:22 
AnswerRe: White Board Pin
Christian Graus11-Jun-08 19:44
protectorChristian Graus11-Jun-08 19:44 
GeneralRe: White Board Pin
Usharva11-Jun-08 19:52
Usharva11-Jun-08 19:52 
QuestionC# error Pin
Susanmat11-Jun-08 19:18
Susanmat11-Jun-08 19:18 
AnswerRe: C# error Pin
Christian Graus11-Jun-08 19:43
protectorChristian Graus11-Jun-08 19:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.