Here you can find the source of formatBigDecimal(BigDecimal bigDecimal)
Parameter | Description |
---|---|
bigDecimal | a parameter |
public static String formatBigDecimal(BigDecimal bigDecimal)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.text.DecimalFormatSymbols; import java.util.Locale; public class Main { /**//from ww w . j a va 2 s . c om * Formats a BigDecimal to a String according to JVM Locale. * * @param bigDecimal * @return */ public static String formatBigDecimal(BigDecimal bigDecimal) { DecimalFormatSymbols dfs = new DecimalFormatSymbols(Locale.getDefault()); String result = String.valueOf(bigDecimal.doubleValue()); result = result.replace('.', dfs.getDecimalSeparator()); return result; } }