Adding Commas to integers: From 2147483647 to 2,147,483,647

    Joined
    Jun 27, 2013
    Messages
    8
    Reaction score
    13
    • Legacy Citizen 2
    • Purchased!
    This ought to be self-explanatory, but I'll explain anyways. Anyone who owns a ship of any large size has a hard time reading off their stats because quite simply, there are no commas in the giant numbers. Just look at the two numbers in the title of this thread and tell me which one is easier to read. It's a subtle difference, but separating a wad of digits into manageable chunks makes it a lot easier to read, and that will collectively save the Starmade community hundreds of hours of squinting. (On a side note, 2.147 billion is exactly 2 to the 31st power - 1, the maximum size of a 32-bit signed integer in computing. The more you know...)

    Stats that should have commas in them include shields, shield regen, power, power storage, number of blocks in a stack, ship mass, credits, memory taken/free/total and maybe others if anyone thinks of any more to add.

    That's pretty much it. So yeah, commas.
     
    Joined
    Jan 5, 2014
    Messages
    100
    Reaction score
    26
    • Legacy Citizen 2
    I'll be honest. This is a good idea that I've wanted to be a reality for some time. I'm a full retard when it comes to mathematical qualities, so simple commas in between the numbers would greatly help me with some of the ship-based calculations I do. Anywhere from money to numbers of blocks, this is a good idea. And it sounds simple enough to put into the game relatively easily...
     

    Lecic

    Convicted Lancake Abuser
    Joined
    Apr 14, 2013
    Messages
    5,107
    Reaction score
    1,228
    • Thinking Positive Gold
    • Purchased!
    • Legacy Citizen 11
    There were numerous threads on the old forums about this. And it still rings true. We seriously need this. I haven't done a lot of coding myself (just a few text-based python games), but I don't think it would be that hard to implement.
     
    Joined
    Oct 3, 2013
    Messages
    16
    Reaction score
    27
    I don't understand why this isn't already implemented... It should be easy to do :)
     
    Joined
    Sep 11, 2013
    Messages
    348
    Reaction score
    147
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 4
    This should be implemented ASAP. It is simple readability and not hard to implement.
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    we had this topic ago.

    Please with apostrophes 2'342''332 not commas. they are too easy to confuse with dots!
     

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    Please with apostrophes 2'342''332 not commas. they are too easy to confuse with dots!
    That's an interesting idea I hadn't thought of before. Maybe make the intervening character server-configurable so the server admin can use whatever character they prefer? Most new players will not understand the numbers with apostrophes. They'll think it's some strange coordinate system until they figure it out, which could hurt the game (bad reviews, fewer new players, etc.).
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    That's an interesting idea I hadn't thought of before. Maybe make the intervening character server-configurable so the server admin can use whatever character they prefer? Most new players will not understand the numbers with apostrophes. They'll think it's some strange coordinate system until they figure it out, which could hurt the game (bad reviews, fewer new players, etc.).
    So unknown?
    Always these stupid USA-peoples which try to enforce their stupid standards using two similar characters with so different purpose for something as basic as math :p
    Maybe government tries to discourage the majority of peoples from leaning math and understanding how powerful information can be? :)


    I would prefer a client-side option with a sane default.

    Maybe they can inherit that sane default from servers, but that would raise confusion if numbers on public server A and B are looking different :D
     
    • Like
    Reactions: jayman38
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    So unknown?
    Always these stupid USA-peoples which try to enforce their stupid standards using two similar characters with so different purpose for something as basic as math :p
    Maybe government tries to discourage the majority of peoples from leaning math and understanding how powerful information can be? :)


    I would prefer a client-side option with a sane default.

    Maybe they can inherit that sane default from servers, but that would raise confusion if numbers on public server A and B are looking different :D
    Don't forget, that dot and comma switch meaning in numbers in some countries(compared to the US)
     

    Mered4

    Space Triangle Builder
    Joined
    Jan 12, 2014
    Messages
    662
    Reaction score
    190
    • Community Content - Bronze 2
    • Purchased!
    • Legacy Citizen 4
    I was actually taught how to do this in java. Maybe I can play with it and see if I can come up with a quick method to convert between float and string......
    Hmm
     
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    I was actually taught how to do this in java. Maybe I can play with it and see if I can come up with a quick method to convert between float and string......
    Hmm
    It is so easy I doubt the community will have to even bother with it.
     

    Mered4

    Space Triangle Builder
    Joined
    Jan 12, 2014
    Messages
    662
    Reaction score
    190
    • Community Content - Bronze 2
    • Purchased!
    • Legacy Citizen 4
    It is so easy I doubt the community will have to even bother with it.
    Since it has yet to be added, I'm gonna. Maybe I can figure out a way to mod it in ;)[DOUBLEPOST=1410205012,1410203518][/DOUBLEPOST]Ok, here's the file. The class is just for structuring, the method and imports can be relocated practically anywhere in the code.

    Hoping that someone can mod this in before I give it a shot later tonight.
     

    Attachments

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    I was actually taught how to do this in java. Maybe I can play with it and see if I can come up with a quick method to convert between float and string......
    Hmm
    JavaScript:
    System.out.println("Value x = "+ x +" and value y = "+ y +"!");
    System.out.printf("Value x = %i and value y = %f!", intValue, floatValue);
    
    String.split("([0..9])[0,3]([0..9])[3,3]+").concatenate('"'); // would do the inserts
    /* EDIT: Got ninjaed :)
       Mine is easer but Mered uses the system settings of what you prefer. More intuitive for a large project.
    */
     
    Last edited: