Java BigDecimal Format formatFAAssertRatioWithoutPercent(BigDecimal value)

Here you can find the source of formatFAAssertRatioWithoutPercent(BigDecimal value)

Description

format FA Assert Ratio Without Percent

License

Apache License

Declaration

public static String formatFAAssertRatioWithoutPercent(BigDecimal value) 

Method Source Code


//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
}

Related

  1. formatDouble(Double toFormat)
  2. formatDouble(double value, int decimalPlaces)
  3. formatDoubleNumber(double f)
  4. formatDoubleValue(int medianAfterTheDecimalPoint, String doubleStringValue)
  5. formate(BigDecimal amount)
  6. formatFileSize(double size)
  7. formatFloat0(String value, int n)
  8. formatForPercentage(BigDecimal value)
  9. formatManey(BigDecimal date)