Here you can find the source of getRealEye(double eye)
public static String getRealEye(double eye)
//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"; } } }