Here you can find the source of formatAsReadable(BigDecimal number)
Parameter | Description |
---|---|
number | the BigDecimal to be formatted |
public static String formatAsReadable(BigDecimal number)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; import java.text.DecimalFormat; public class Main { private static final DecimalFormat humanReadableFormat = new DecimalFormat("#0.00"); /**//ww w . j a v a2s. c o m * Formats the given {@code BigDecimal} to a readable String. * * @param number the {@code BigDecimal} to be formatted * @return the formatted number with precision two */ public static String formatAsReadable(BigDecimal number) { return humanReadableFormat.format(number); } }