Java Number Round roundSonekiSuii(double amount1, double amount2)

Here you can find the source of roundSonekiSuii(double amount1, double amount2)

Description

round Soneki Suii

License

Open Source License

Declaration

public static double roundSonekiSuii(double amount1, double amount2) 

Method Source Code

//package com.java2s;
/*//from ww w  . j  ava2s.  c  o m
 * Copyright(C) 2014
 * NEC Corporation All rights reserved.
 * 
 * No permission to use, copy, modify and distribute this software
 * and its documentation for any purpose is granted.
 * This software is provided under applicable license agreement only.
 */

public class Main {
    public static double roundSonekiSuii(double amount1, double amount2) {
        return round(((amount1 / amount2) * 100), 1);
    }

    public static double round(double value, int precision) {
        int scale = (int) Math.pow(10, precision);
        return (double) Math.round(value * scale) / scale;
    }
}

Related

  1. roundSig(double d, int n)
  2. roundSignificant(double d, int numDigit, boolean keepInteger)
  3. roundSignificant(double value)
  4. roundSimpleNumberUnits(final long graphDefaultUnit)
  5. roundSizes(float[] sizes)
  6. roundsToTicks(double x)
  7. roundStr(Double value, int decimal)
  8. roundString(double d)
  9. roundString(double n, double range, double precision)