Click here to Skip to main content
15,898,769 members
Home / Discussions / C#
   

C#

 
QuestionUserPrinicipal Enabled... Nullable type? Pin
Jacob Dixon27-Mar-09 9:18
Jacob Dixon27-Mar-09 9:18 
AnswerRe: UserPrinicipal Enabled... Nullable type? Pin
Big Daddy Farang27-Mar-09 12:05
Big Daddy Farang27-Mar-09 12:05 
GeneralRe: UserPrinicipal Enabled... Nullable type? Pin
Jacob Dixon27-Mar-09 12:08
Jacob Dixon27-Mar-09 12:08 
GeneralRe: UserPrinicipal Enabled... Nullable type? Pin
Big Daddy Farang27-Mar-09 12:48
Big Daddy Farang27-Mar-09 12:48 
QuestionRounding statement not working in C# program Pin
Vin Calitri27-Mar-09 8:56
Vin Calitri27-Mar-09 8:56 
AnswerRe: Rounding statement not working in C# program Pin
Alan N27-Mar-09 9:32
Alan N27-Mar-09 9:32 
AnswerRe: Rounding statement not working in C# program Pin
Ian Shlasko27-Mar-09 10:06
Ian Shlasko27-Mar-09 10:06 
AnswerRe: Rounding statement not working in C# program Pin
Luc Pattyn27-Mar-09 21:29
sitebuilderLuc Pattyn27-Mar-09 21:29 
Hi,

why would you call ToString() and then Parse() to turn a number into another number? This is nonsense, as it wastes lots of CPU cycles: numbers are stored in binary for a reason, it takes a lot of divide-by-10s to perform a ToString() on a number.

Math.Round does rounding in the regular way, i.e. 1-4 go down, 5-9 go up.
However you want 1-9 to go up, hence add 0.04 to the original number, then use Math.Round

Warning: you did not define how it should work for negative numbers; whatever straight code you come up with, there is a 50% chance it won't do what you want for negative numbers. If so, test for negative, and provide two different formulas.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


GeneralRe: Rounding statement not working in C# program Pin
Vin Calitri31-Mar-09 2:33
Vin Calitri31-Mar-09 2:33 
Questionbuttons click event is fire accurately but radiobuttonlist controls SelectIndexChanged event is not fired help me !! Pin
jyoti_goel27-Mar-09 7:33
jyoti_goel27-Mar-09 7:33 
AnswerRe: buttons click event is fire accurately but radiobuttonlist controls SelectIndexChanged event is not fired help me !! Pin
Xmen Real 27-Mar-09 8:37
professional Xmen Real 27-Mar-09 8:37 
Question[Message Deleted] Pin
Ibrahim Bello27-Mar-09 6:56
Ibrahim Bello27-Mar-09 6:56 
AnswerRe: Change GridView Column Header Text Pin
fly90427-Mar-09 7:04
fly90427-Mar-09 7:04 
JokeRe: [Message Deleted] Pin
musefan27-Mar-09 7:41
musefan27-Mar-09 7:41 
GeneralRe: [Message Deleted] Pin
Ibrahim Bello27-Mar-09 8:28
Ibrahim Bello27-Mar-09 8:28 
GeneralRe: [Message Deleted] Pin
#realJSOP27-Mar-09 8:42
professional#realJSOP27-Mar-09 8:42 
QuestionProgmatically Creating TreeNodes and Child Nodes [modified] Pin
maxatlis27-Mar-09 5:44
maxatlis27-Mar-09 5:44 
AnswerRe: Progmatically Creating TreeNodes and Child Nodes [modified] Pin
musefan27-Mar-09 6:02
musefan27-Mar-09 6:02 
GeneralRe: Progmatically Creating TreeNodes and Child Nodes Pin
maxatlis27-Mar-09 6:11
maxatlis27-Mar-09 6:11 
GeneralRe: Progmatically Creating TreeNodes and Child Nodes Pin
maxatlis27-Mar-09 6:27
maxatlis27-Mar-09 6:27 
GeneralRe: Progmatically Creating TreeNodes and Child Nodes Pin
musefan27-Mar-09 6:34
musefan27-Mar-09 6:34 
GeneralRe: Progmatically Creating TreeNodes and Child Nodes Pin
maxatlis27-Mar-09 6:44
maxatlis27-Mar-09 6:44 
GeneralRe: Progmatically Creating TreeNodes and Child Nodes Pin
musefan27-Mar-09 6:49
musefan27-Mar-09 6:49 
GeneralRe: Progmatically Creating TreeNodes and Child Nodes Pin
maxatlis27-Mar-09 7:10
maxatlis27-Mar-09 7:10 
GeneralRe: Progmatically Creating TreeNodes and Child Nodes Pin
fly90427-Mar-09 7:54
fly90427-Mar-09 7:54 

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.