Decimal Formatting

Discussion in 'Plugin Development' started by Mrcool234, Apr 25, 2014.

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

    Mrcool234

    Ok so i made a KDR plugin a it works but when whenever you hit a whole number instead of saying 1.00 it says 1 and also i want to make the default amount 0.00 when you start but it says i cant divide by 1 please help

    Code:
    http://pastebin.com/wPUyeNJB
     
  2. Offline

    raGan.

    Try
    Code:
    String formattedKDR = String.format("%.2f", kdr);
     
  3. Offline

    BillyGalbreath

    DecimalFormat df = new DecimalFormat("#.00");

    The '0' means always show that spot. The '#' means show it if there is a value there.
     
Thread Status:
Not open for further replies.

Share This Page