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

C#

 
AnswerRe: Await - Async not so simple to use? Pin
Richard Deeming25-Jan-17 3:12
mveRichard Deeming25-Jan-17 3:12 
GeneralRe: Await - Async not so simple to use? Pin
Richard Andrew x6425-Jan-17 10:08
professionalRichard Andrew x6425-Jan-17 10:08 
QuestionDelegates Pin
Member 1202181724-Jan-17 2:13
Member 1202181724-Jan-17 2:13 
AnswerRe: Delegates Pin
Richard Deeming24-Jan-17 2:20
mveRichard Deeming24-Jan-17 2:20 
AnswerRe: Delegates Pin
OriginalGriff24-Jan-17 2:26
mveOriginalGriff24-Jan-17 2:26 
QuestionPlz Send Me The Simpler Answer to connect with SSIS And SSRS Both In any Version fo the Excell Pin
Member 889223723-Jan-17 23:45
Member 889223723-Jan-17 23:45 
GeneralRe: Plz Send Me The Simpler Answer to connect with SSIS And SSRS Both In any Version fo the Excell Pin
Richard MacCutchan24-Jan-17 0:42
mveRichard MacCutchan24-Jan-17 0:42 
Questionnumber converter Pin
ab_ayo23-Jan-17 1:51
ab_ayo23-Jan-17 1:51 
Why is my code not returning numbers such as 20000, 30000, 40000 etc. it just returns twenty and ignores the thousand.
C#
Console.WriteLine(DateTime.Now);
            Console.WriteLine("Welcome To Ayoola's Number Converter");
            string[] units = new string[] { " ","ONE ", "TWO ", "THREE ", "FOUR ", "FIVE ", "SIX ", "SEVEN ", "EIGHT ", "NINE ", "TEN ", "ELEVEN ", "TWELVE ", "THIRTEEN ", "FOURTEEN ", "FIFTEEN ", "SIXTEEN ", "SEVENTEEN ", "EIGHTEEN ", "NINETEEN " };
            string[] tens = new string[] { " ","TEN ", "TWENTY ", "THIRTY ", "FOURTY ", "FIFTY ", "SIXTY ", "SEVENTY ", "EIGHTY ", "NINETY " };
            string[] big = new string[] { "hundred ", "Thousand ", "million", "billion" };
            long i, num;
            string result = "";
            Console.WriteLine("Enter number here : ");
            String input = Console.ReadLine();
            num = long.Parse(input);
            if (num < 1000000000000 && num > 99999999999)
            {
                i = num / 100000000000;
                result = units[i] + "HUNDRED " + "AND ";
                num = num % 100000000000;
            }
            if (num > 19999999999 && num < 100000000000)
            {
                i = num / 10000000000;
                result += tens[i];
                num = num % 10000000000;
            }
            if (num > 999999999 && num < 20000000000)
            {
                i = num / 1000000000;
                result += units[i] + "BILLION ";
                num = num % 1000000000;
            }
            if (num > 99999999 && num < 1000000000)
            {
                i = num / 100000000;
                result += units[i] + "HUNDRED " + "AND ";
                num = num % 100000000;
            }
            if (num >= 20000000 && num < 100000000)
            {
                i = num / 10000000;
                result += tens[i] ;
                num = num % 10000000;}
            if (num >= 1000000 && num < 20000000)
            {
                i = num / 1000000;
                result += units[i] + "MILLION ";
                num = num % 1000000;
            }
            if (num > 100000 && num < 1000000)
            {
                i = num / 100000;
                result += units[i] + "HUNDRED " + "AND " ;
                num = num % 100000;
            }
            if (num > 19999 && num < 100000)
            {
                i = num / 10000;
                result += tens[i];
                num = num % 10000;
            }
            if (num > 999 && num <= 19999)
            {
                i = num / 1000;
                result += units[i] + "THOUSAND ";
                num = num % 1000;
            }
            if (num > 99 && num < 1000)
            {
                i = num / 100;
                result += units[i] + "HUNDRED " + "AND ";
                num = num % 100;
            }
            if (num > 19 && num < 100)
            {
                i = num / 10;
                result = result + tens[i];
                num = num % 10;
            }
            if (num < 20 && num >= 0)
            { result += units[num]; }
            if (num == 0)
                result += "";
            Console.WriteLine("The number in words: " + result);
            string sample = "1234";

            //int length = sample.Length;

            //for (int k = 0; k < sample.Length; k--)
            //{
                //sample.Substring(0, 3);
               // var seria = sample.Substring(k-3, 3);
                //k = k * 2;
                //int lengthSubString;
                //string subString = sample.Substring(startIndex, lengthSubString);
                //Console.WriteLine("substring  --> " + seria);
            //}
            string s = "1234";
            for (int y = s.Length ; y > 0; y-= 3 )
            {
                if(y-3 > 0)
                {
                    Console.WriteLine(s.Substring(y - 3, 3));
                }    
            }
            Console.WriteLine(sample.Substring(1,3));
            Console.ReadLine();

AnswerRe: number converter Pin
Richard MacCutchan23-Jan-17 2:07
mveRichard MacCutchan23-Jan-17 2:07 
AnswerRe: number converter Pin
Patrice T23-Jan-17 9:52
mvePatrice T23-Jan-17 9:52 
GeneralRe: number converter Pin
Ed E24-Jan-17 9:22
professionalEd E24-Jan-17 9:22 
AnswerRe: number converter Pin
palikhelsanjeeb25-Jan-17 21:55
palikhelsanjeeb25-Jan-17 21:55 
QuestionHow to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu22-Jan-17 21:49
professionalTarunKumarSusarapu22-Jan-17 21:49 
AnswerRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Afzaal Ahmad Zeeshan22-Jan-17 23:43
professionalAfzaal Ahmad Zeeshan22-Jan-17 23:43 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu23-Jan-17 0:44
professionalTarunKumarSusarapu23-Jan-17 0:44 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Afzaal Ahmad Zeeshan23-Jan-17 1:08
professionalAfzaal Ahmad Zeeshan23-Jan-17 1:08 
AnswerRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Simon_Whale23-Jan-17 0:27
Simon_Whale23-Jan-17 0:27 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu23-Jan-17 0:45
professionalTarunKumarSusarapu23-Jan-17 0:45 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Pete O'Hanlon23-Jan-17 0:46
mvePete O'Hanlon23-Jan-17 0:46 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Simon_Whale23-Jan-17 0:47
Simon_Whale23-Jan-17 0:47 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu23-Jan-17 0:54
professionalTarunKumarSusarapu23-Jan-17 0:54 
SuggestionRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Richard Deeming23-Jan-17 3:17
mveRichard Deeming23-Jan-17 3:17 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu23-Jan-17 18:10
professionalTarunKumarSusarapu23-Jan-17 18:10 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
TarunKumarSusarapu23-Jan-17 18:57
professionalTarunKumarSusarapu23-Jan-17 18:57 
GeneralRe: How to save values in table in SQL without crashing when it is used by multiple users Pin
Richard Deeming24-Jan-17 2:05
mveRichard Deeming24-Jan-17 2:05 

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.