Java Number Round roundCss(double v, int n)

Here you can find the source of roundCss(double v, int n)

Description

round Css

License

Open Source License

Declaration

public static String roundCss(double v, int n) 

Method Source Code

//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]);
    }
}

Related

  1. roundByGridSize(int value)
  2. roundByte(final double value)
  3. roundBytesToGB(long bytes)
  4. roundBytesUpToWords(int bytes)
  5. roundChipRewardDown(long chips)
  6. rounded(double value, int places, int ceilOrFloor)
  7. ROUNDED_DIV(long a, long b)
  8. rounded_shift_down(long x, int n)
  9. roundedApply(double value, double percent, double delta)