Here you can find the source of formatFAAssertRatioWithoutPercent(BigDecimal value)
public static String formatFAAssertRatioWithoutPercent(BigDecimal value)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; import java.math.RoundingMode; import java.text.DecimalFormat; public class Main { public static final String FA_ASSERT_RATIO_FORMAT = "0.#######%"; public static String formatFAAssertRatioWithoutPercent(BigDecimal value) { DecimalFormat decimalFormat = new DecimalFormat(FA_ASSERT_RATIO_FORMAT); decimalFormat.setRoundingMode(RoundingMode.DOWN); return decimalFormat.format(value).substring(0, decimalFormat.format(value).length() - 1); }//from w w w .jav a2 s . com }