Here you can find the source of formatDecimal(double size)
Parameter | Description |
---|---|
size | Size to format. |
public static String formatDecimal(double size)
//package com.java2s; import java.math.RoundingMode; import java.text.DecimalFormat; public class Main { /**//www . j a v a 2s . co m * Format decimal numbers to #.## * * @param size * Size to format. * @return Decimal formatted. */ public static String formatDecimal(double size) { DecimalFormat df = new DecimalFormat("#.###"); df.setRoundingMode(RoundingMode.CEILING); return df.format(size); } }