Java Number Round roundTo2Digits(double amount)

Here you can find the source of roundTo2Digits(double amount)

Description

round To Digits

License

Apache License

Declaration

public static double roundTo2Digits(double amount) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static double roundTo2Digits(double amount) {

        long number2 = Math.round(amount * 100);
        return (double) (number2 / 100);
    }//www . j  ava2  s  .c o  m
}

Related

  1. roundTo(float number, int base)
  2. roundTo(float number, int numPlaces)
  3. roundTo(float val, int numPlaces)
  4. roundTo100th(double w)
  5. roundTo2Decimals(double value)
  6. roundTo2SigPlaces(double value)
  7. roundTo3Places(double n)
  8. roundTo6decimals(Double x)
  9. roundToAccuracy(float n, float i)