Here you can find the source of roundCss(double v, int n)
public static String roundCss(double v, int n)
//package com.java2s; /*/*from w w w . j a va 2 s . c om*/ * Copyright (C) 2009 Emweb bvba, Leuven, Belgium. * * See the LICENSE file for terms of use. */ public class Main { private static double e[] = new double[] { 1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0 }; public static String roundCss(double v, int n) { return String.valueOf(Math.round(v * e[n]) / e[n]); } }