Java Double Number Truncate truncate(double value, int truncation)

Here you can find the source of truncate(double value, int truncation)

Description

truncate

License

LGPL

Declaration

public static double truncate(double value, int truncation) 

Method Source Code

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

public class Main {
    public static double truncate(double value, int truncation) {
        return Math.floor(value * truncation) / truncation;
    }//from   ww  w  .j  av a 2  s.c om
}

Related

  1. truncate(double d)
  2. truncate(double fullVal, int digits)
  3. truncate(double oldVal, double newMin, double newMax)
  4. truncate(double value, double precision)
  5. truncate(double value, int precision)
  6. truncate(double x)
  7. truncate(double x)
  8. truncate(double x, double gran)
  9. truncate(double[] arr, int m)