Thread: 2M Instead of 2,000K

Results 1 to 9 of 9
  1. #1 2M Instead of 2,000K 
    Registered Member
    Noosy's Avatar
    Join Date
    Feb 2008
    Age
    26
    Posts
    392
    Thanks given
    39
    Thanks received
    7
    Rep Power
    107
    Title says it all... I want to change the displayed amount of stackable items from say, 2000K to 2M, to make it shorter. I've looked into the intToKOrMil method, can't seem to get it to change though.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Sep 2009
    Posts
    3,247
    Thanks given
    195
    Thanks received
    255
    Rep Power
    0
    Client side, think 2pac released a snippet.
    Reply With Quote  
     

  3. #3  
    Donator

    Ecstasy's Avatar
    Join Date
    Sep 2008
    Age
    26
    Posts
    5,032
    Thanks given
    324
    Thanks received
    596
    Rep Power
    843
    Can you show me the method? I'll give it a shot.

    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Sep 2009
    Posts
    3,247
    Thanks given
    195
    Thanks received
    255
    Rep Power
    0
    There isn't one that's the point =D
    Reply With Quote  
     

  5. #5  
    Registered Member
    Noosy's Avatar
    Join Date
    Feb 2008
    Age
    26
    Posts
    392
    Thanks given
    39
    Thanks received
    7
    Rep Power
    107
    I know it's client-sided, and I've just gone through all of 2pac's threads, found nothing about changing the appearance of stackable numbers.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  6. #6  
    Renown Programmer
    Method's Avatar
    Join Date
    Feb 2009
    Posts
    1,455
    Thanks given
    0
    Thanks received
    843
    Rep Power
    3019
    This should display all values above one million using the letter "M" instead of "K".

    Code:
    private static String intToKOrMil(int j)
    {
        if(j < 0x186a0)
            return String.valueOf(j);
        if(j < 0xf4240)
            return j / 1000 + "K";
        else
            return j / 0xf4240 + "M";
    }
    :-)
    Reply With Quote  
     

  7. #7  
    Registered Member
    Noosy's Avatar
    Join Date
    Feb 2008
    Age
    26
    Posts
    392
    Thanks given
    39
    Thanks received
    7
    Rep Power
    107
    Quote Originally Posted by Method View Post
    This should display all values above one million using the letter "M" instead of "K".

    Code:
    private static String intToKOrMil(int j)
    {
        if(j < 0x186a0)
            return String.valueOf(j);
        if(j < 0xf4240)
            return j / 1000 + "K";
        else
            return j / 0xf4240 + "M";
    }
    Wow, thanks.

    Edit: forgot to mention this, but what about changing 1,000 to 1K?
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #8  
    Renown Programmer
    Method's Avatar
    Join Date
    Feb 2009
    Posts
    1,455
    Thanks given
    0
    Thanks received
    843
    Rep Power
    3019
    You could change that to this to achieve that functionality:

    Code:
    private static String intToKOrMil(int j)
    {
        if(j < 0x3e8)
            return String.valueOf(j);
        if(j < 0xf4240)
            return j / 1000 + "K";
        else
            return j / 0xf4240 + "M";
    }
    :-)
    Reply With Quote  
     

  9. #9  
    Client God

    Join Date
    Aug 2009
    Posts
    3,130
    Thanks given
    3
    Thanks received
    614
    Rep Power
    896
    ^It works but it looks fugly imo =| (was testing to confirm...)

    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •