Solved 1,000 instead of 1000

Discussion in 'Plugin Development' started by MordorKing78, Jul 23, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    MordorKing78

    Heyo!
    What I need to know is how I turn for example this integer of 12391 to 12,391 or 1239190 to 1,239,190!
    I just need it to show that in an string (as a message).

    if anyone knows a simple way of doing this that would be great!
    Thank you!

    Kind Regards, OrpheuZ
     
  2. Offline

    thapengwin

  3. @MordorKing78 @thapengwin
    Indeed, Decimal Format is the way to go, but one thing to keep in mind is the locale of different users, for instance, if an american were to format "1233" with "#,###" it would become "1,233", but if I were to run it with my Swedish JRE, it would become "1.233". This is because many countries in europe have the decimal operators switched, "," is used as the decimal point, and "." is used to seperate every three digits.
     
  4. Offline

    MordorKing78

    @AlvinB I'm looking to do it with ","

    @thepengwin Lulz, I only looked for Bukkit API results :p

    Thanks tho I'll look into it :)!
     
  5. @MordorKing78
    I was just pointing it out, you never know where the users of your plugins come from :)

    Also, if this thread is solved, please mark it as such.
     
  6. Offline

    MordorKing78

    @AlvinB Netherlands here ( ͡° ͜ʖ ͡°)
     
  7. Offline

    thapengwin

    Mark this as solved, please.
     
  8. Offline

    MordorKing78

    @thapengwin I'm still looking into it but I'll solve it.
     
Thread Status:
Not open for further replies.

Share This Page