Here you can find the source of roundFormat(final int numPrec, final double number)
Parameter | Description |
---|---|
numPrec | the num prec |
number | the number |
public static String roundFormat(final int numPrec, final double number)
//package com.java2s; //License from project: LGPL public class Main { /**//from w ww . j a v a 2 s. com * Round format. * * @param numPrec the num prec * @param number the number * @return the string */ public static String roundFormat(final int numPrec, final double number) { return String.format("%." + numPrec + "f", number); } }