Solved Ranking - getting K/D and W/L error

Discussion in 'Plugin Development' started by rfsantos1996, Dec 2, 2013.

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

    rfsantos1996

    Code:java
    1. public String getWinLossRatio() {
    2. int lose = loses; // dont change the real value
    3. if (lose == 0) {
    4. lose = 1;
    5. }
    6. double d = (wins / lose);
    7. return Double.toString(d); // Tried everything to make it shows X.XX
    8. }


    It should appear 0.56 (9 divided by 16 = 0.5625) instead, it shows 0.0
    And in other case, it should appear 1.2 but it shows 1.0 (6/5)

    If you want to look harder in my code: click me
     
  2. Offline

    MrSnare

    try
    Code:java
    1. double d = wins * 1.0 / lose;
     
    rfsantos1996 likes this.
  3. Offline

    rfsantos1996

    WOW, THAT WORKED WTF

    Really thanks man (;
     
    MrSnare likes this.
  4. Offline

    MrSnare

    Don't thank me, thank America!
     
    rfsantos1996 likes this.
Thread Status:
Not open for further replies.

Share This Page