1 - 14 of 14 Posts

zodac

·
Joined
·
46,128 Posts
Discussion Starter · ·
If I've got an array of integers, how do I output them as (for example) 999,999 instead of 999999?

tindolos

·
Registered
Joined
·
1,351 Posts
Umm off the top of my head you could probably concatenate all of it as a string. Store both halves into a separate string and concatenate it all with a comma. Maybe not the best solution, but would probably work.

zodac

zodac

·
Joined
·
46,128 Posts
Discussion Starter · ·
And I would do that how?

tindolos

·
Registered
Joined
·
1,351 Posts
Is the value 999,999 a single item in the array? Or is each 9 an element in the array?

zodac

·
Joined
·
46,128 Posts
Discussion Starter · ·
Single item.

fshizl

·
Registered
Joined
·
2,552 Posts
couldnt you type it in? 999,999???

if anything do float p=999,999 example... float will let you use decimals, it might also let you use comas

TheSchlaf

·
Registered
R5 3600 / X570 Aorus Elite WIFI / EVGA RTX 3080 Ti FTW3
Joined
·
1,113 Posts
zodac

zodac

·
Joined
·
46,128 Posts
Discussion Starter · ·
Quote:
 Originally Posted by fshizl couldnt you type it in? 999,999??? if anything do float p=999,999 example... float will let you use decimals, it might also let you use comas
Well, I'm calculating primes, then putting them into an array, so I don't think that would work...

Quote:
 Originally Posted by TheSchlaf see here: http://www.daniweb.com/forums/thread261786.html GIYF.
Using that method, would I have to convert every item in the array to a string, or is there a faster method?

L3gacy

·
Registered
Joined
·
1,183 Posts
how many members do you have in your array?

zodac

·
Joined
·
46,128 Posts
Discussion Starter · ·
It changes... looking for all primes from 1-100, then anywhere up to 10,000,000...

L3gacy

·
Registered
Joined
·
1,183 Posts
would you mind posting the code?
Unless its monstorous in size

zodac

·
Joined
·
46,128 Posts
Discussion Starter · ·
My code isn't anywhere near done, since I need to do other stuff to it first (some bitshifting involved, and gotta try that next).

I was hoping that seperating by commas would be an easy task... doesn't look like it though.

·
Joined
·
1,183 Posts

·