Click here to Skip to main content
15,896,111 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to split input integer variable Pin
#realJSOP22-Jan-10 10:23
professional#realJSOP22-Jan-10 10:23 
GeneralRe: how to split input integer variable Pin
Luc Pattyn22-Jan-10 10:46
sitebuilderLuc Pattyn22-Jan-10 10:46 
GeneralRe: how to split input integer variable Pin
#realJSOP22-Jan-10 11:05
professional#realJSOP22-Jan-10 11:05 
AnswerRe: how to split input integer variable [modified] Pin
#realJSOP22-Jan-10 10:36
professional#realJSOP22-Jan-10 10:36 
GeneralRe: how to split input integer variable [modified] Pin
Luc Pattyn22-Jan-10 11:32
sitebuilderLuc Pattyn22-Jan-10 11:32 
GeneralRe: how to split input integer variable Pin
#realJSOP22-Jan-10 12:46
professional#realJSOP22-Jan-10 12:46 
AnswerRe: how to split input integer variable [modified] Pin
#realJSOP23-Jan-10 2:16
professional#realJSOP23-Jan-10 2:16 
AnswerRe: how to split input integer variable Pin
#realJSOP23-Jan-10 5:04
professional#realJSOP23-Jan-10 5:04 
And finally, the pointless math exercise extracting the digits from left to right instead of right to left.

bool isNegative = (value < 0);
List<int> digits = new List<int>();
int value = int.MinValue;
double i = 9;
double power = 0;
while (value != 0)
{
    power = Math.Pow(10d, i);
    int result = (value - (value % (int)power));
    int addResult = (int)((double)result / power) * ((isNegative && (int)i == 9) ? 1 : -1);
    digits.Add(addResult);
    value -= result;
    i--;
}


I hope you can see by my persistence that I've found several similar ways to accomplish the stated goal. This is part of what makes a good programmer.

.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

Questionget data from SSRS report Pin
Mohamed El-Wehishy22-Jan-10 7:20
Mohamed El-Wehishy22-Jan-10 7:20 
QuestionA Dialog bug (Edited) Pin
Muammar©22-Jan-10 7:04
Muammar©22-Jan-10 7:04 
AnswerRe: A Dialog bug (Edited) Pin
Som Shekhar22-Jan-10 7:20
Som Shekhar22-Jan-10 7:20 
GeneralRe: A Dialog bug (Edited) Pin
Muammar©22-Jan-10 20:10
Muammar©22-Jan-10 20:10 
GeneralRe: A Dialog bug (Edited) Pin
Som Shekhar22-Jan-10 20:16
Som Shekhar22-Jan-10 20:16 
AnswerRe: A Dialog bug (Edited) Pin
loyal ginger22-Jan-10 7:26
loyal ginger22-Jan-10 7:26 
GeneralRe: A Dialog bug (Edited) Pin
Ravi Bhavnani22-Jan-10 7:47
professionalRavi Bhavnani22-Jan-10 7:47 
GeneralRe: A Dialog bug (Edited) Pin
loyal ginger22-Jan-10 8:08
loyal ginger22-Jan-10 8:08 
GeneralRe: A Dialog bug (Edited) Pin
Ravi Bhavnani22-Jan-10 8:11
professionalRavi Bhavnani22-Jan-10 8:11 
GeneralRe: A Dialog bug (Edited) Pin
Muammar©22-Jan-10 20:30
Muammar©22-Jan-10 20:30 
GeneralRe: A Dialog bug (Edited²) Pin
Ravi Bhavnani23-Jan-10 5:16
professionalRavi Bhavnani23-Jan-10 5:16 
GeneralRe: A Dialog bug (Edited) Pin
Ravi Bhavnani23-Jan-10 5:23
professionalRavi Bhavnani23-Jan-10 5:23 
GeneralRe: A Dialog bug (Edited) Pin
Muammar©23-Jan-10 5:46
Muammar©23-Jan-10 5:46 
GeneralRe: A Dialog bug (Edited) Pin
Ravi Bhavnani23-Jan-10 5:50
professionalRavi Bhavnani23-Jan-10 5:50 
GeneralRe: A Dialog bug (Edited) Pin
Muammar©23-Jan-10 5:57
Muammar©23-Jan-10 5:57 
GeneralRe: A Dialog bug (Edited) Pin
Muammar©22-Jan-10 20:27
Muammar©22-Jan-10 20:27 
AnswerRe: A Dialog bug (Edited) Pin
Ravi Bhavnani22-Jan-10 7:46
professionalRavi Bhavnani22-Jan-10 7:46 

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.