Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
GeneralRe: How store all TabPage items in c# Pin
Richi38125-Apr-19 20:29
Richi38125-Apr-19 20:29 
AnswerRe: How store all TabPage items in c# Pin
Gerry Schmitz18-Apr-19 6:09
mveGerry Schmitz18-Apr-19 6:09 
AnswerRe: How store all TabPage items in c# Pin
BillWoodruff18-Apr-19 20:48
professionalBillWoodruff18-Apr-19 20:48 
GeneralRe: How store all TabPage items in c# Pin
Richi38125-Apr-19 21:39
Richi38125-Apr-19 21:39 
AnswerRe: How store all TabPage items in c# Pin
BillWoodruff26-Apr-19 4:09
professionalBillWoodruff26-Apr-19 4:09 
QuestionHow to handle PCB components layout in designing LED switching power supply? Pin
Pcbindex17-Apr-19 19:57
Pcbindex17-Apr-19 19:57 
AnswerRe: How to handle PCB components layout in designing LED switching power supply? Pin
OriginalGriff17-Apr-19 20:05
mveOriginalGriff17-Apr-19 20:05 
Questionlast 3 numbers Pin
_Q12_17-Apr-19 12:04
_Q12_17-Apr-19 12:04 
If i have this number: 100000000000
my code will read it like this:
if (rol > 99999999999) label1.Text = get3digit(rol) + " miliarde";
...
//where get3digit(rol) method is this:
        int get3digit(Int64 myVal)
        {
            char mg1 = myVal.ToString()[0];
            char mg2 = myVal.ToString()[1];
            char mg3 = myVal.ToString()[2];
            char[] chars = { mg1, mg2, mg3 };
            string mg = new string(chars);
            int i = int.Parse(mg);
            return i;
        }
//---RESULT is: "100 miliarde" (for this example) (but up to "999 miliarde");


999999999999 (it means 999 miliarde) and is the Maximum value i will make the code.

Now, I want to split this number by 3 LAST characters !!!
So it will look like this in the end: "100 000 000 000" (yes, with spaces)
Also for other LESS numbers than this one.
100 000 000 000
10 000 000 000
1 000 000 000
100 000 000
10 000 000
1 000 000
100 000
10 000
1 000
and this is the last value to insert the space. So 9 cases. I give multiple of 10 example here to be easy to understand, but it will be other numbers between 0 and 999 milliard.

My idea is to use -char- as i did already, to separate the last numbers.
But... maybe there is some funky way of doing it more easily?
Or AUTOMATIC/ Default way?
Thank you very much.
AnswerRe: last 3 numbers Pin
Gerry Schmitz17-Apr-19 13:05
mveGerry Schmitz17-Apr-19 13:05 
GeneralRe: last 3 numbers Pin
_Q12_17-Apr-19 13:36
_Q12_17-Apr-19 13:36 
AnswerRe: last 3 numbers Pin
Luc Pattyn17-Apr-19 13:11
sitebuilderLuc Pattyn17-Apr-19 13:11 
AnswerRe: last 3 numbers Pin
#realJSOP18-Apr-19 2:04
mve#realJSOP18-Apr-19 2:04 
AnswerRe: last 3 numbers Pin
BillWoodruff18-Apr-19 20:57
professionalBillWoodruff18-Apr-19 20:57 
QuestionWCF Pin
Member 1406752317-Apr-19 4:12
Member 1406752317-Apr-19 4:12 
AnswerRe: WCF Pin
#realJSOP17-Apr-19 4:25
mve#realJSOP17-Apr-19 4:25 
QuestionReferencing Dynamic Control Array Data Pin
Member 1427108416-Apr-19 12:11
Member 1427108416-Apr-19 12:11 
AnswerRe: Referencing Dynamic Control Array Data Pin
Member 1427108416-Apr-19 15:38
Member 1427108416-Apr-19 15:38 
SuggestionRe: Referencing Dynamic Control Array Data Pin
Richard Deeming17-Apr-19 1:07
mveRichard Deeming17-Apr-19 1:07 
AnswerRe: Referencing Dynamic Control Array Data Pin
BillWoodruff16-Apr-19 16:29
professionalBillWoodruff16-Apr-19 16:29 
AnswerRe: Referencing Dynamic Control Array Data Pin
OriginalGriff16-Apr-19 21:22
mveOriginalGriff16-Apr-19 21:22 
QuestionJson formatting using an object in c# Pin
ATLDev15-Apr-19 11:52
ATLDev15-Apr-19 11:52 
AnswerRe: Json formatting using an object in c# Pin
OriginalGriff15-Apr-19 21:21
mveOriginalGriff15-Apr-19 21:21 
GeneralRe: Json formatting using an object in c# Pin
Rob Philpott16-Apr-19 6:21
Rob Philpott16-Apr-19 6:21 
AnswerRe: Json formatting using an object in c# Pin
Richard Deeming16-Apr-19 7:47
mveRichard Deeming16-Apr-19 7:47 
GeneralRe: Json formatting using an object in c# Pin
ATLDev18-Apr-19 6:08
ATLDev18-Apr-19 6:08 

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.