Here you can find the source of roundedPercentageGreaterThan(double left, double right)
public static boolean roundedPercentageGreaterThan(double left, double right)
//package com.java2s; //License from project: Open Source License import java.math.RoundingMode; import java.text.DecimalFormat; public class Main { public static boolean roundedPercentageGreaterThan(double left, double right) { return (left > right) && !formatPercentage(left).equals(formatPercentage(right)); }//from w ww.ja va 2 s.c o m public static String formatPercentage(double d) { DecimalFormat df = new DecimalFormat("0.0"); df.setRoundingMode(RoundingMode.HALF_UP); return df.format(d); } }