Java Decimal Format getRealEye(double eye)

Here you can find the source of getRealEye(double eye)

Description

get Real Eye

License

Apache License

Declaration

public static String getRealEye(double eye) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.DecimalFormat;

public class Main {
    public static String getRealEye(double eye) {
        DecimalFormat df = new DecimalFormat("#.##");
        if (eye == 3.9) {
            return "0.08";
        } else if (eye == 3.8) {
            return "0.06";
        } else if (eye == 3.7) {
            return "0.04";
        } else if (eye == 3.6) {
            return "0.02";
        } else if (eye == 5L) {
            return "5.0";
        } else if (eye == 4L) {
            return "4.0";
        } else if (eye > 4L) {
            return df.format(eye);
        } else {/*from  w ww  .  ja  v a2 s.co  m*/
            return "0";
        }
    }
}

Related

  1. getDurationString(double duration)
  2. getEngineeringNotation(final double d)
  3. getInteger(Double d)
  4. getIntNum(Double value)
  5. getProgressExact(double balance, double cost)
  6. getRedondeoHaciaArriba(double pTotal)
  7. getScientificNotation(double value)
  8. getSpaceMessage(final double bytes)
  9. getStandardDeviationString(double[] standardDeviationDoubles)