Java Double Number Round roundDown(double value, int gridSize)

Here you can find the source of roundDown(double value, int gridSize)

Description

round Down

License

Open Source License

Declaration

public static int roundDown(double value, int gridSize) 

Method Source Code

//package com.java2s;
/**//from ww  w  .  ja  v a2s .co m
 *    Copyright (C) 2009, 2010 
 *    State of California,
 *    Department of Water Resources.
 *    This file is part of DSM2 Grid Map
 *    The DSM2 Grid Map is free software: 
 *    you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *    DSM2 Grid Map is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details. [http://www.gnu.org/licenses]
 *    
 *    @author Nicky Sandhu
 *    
 */

public class Main {
    public static int roundDown(double value, int gridSize) {
        return (int) (Math.floor(value / gridSize) * gridSize);
    }
}

Related

  1. roundDown(double amt, double digits)
  2. roundDown(double n)
  3. roundDown(double num)
  4. roundDown(double val, int decimals)
  5. roundDown(double value, double units)
  6. roundDown(final float realNumber)
  7. RoundDown(final T number)
  8. roundDown(int n, int m)
  9. roundDown(int number, int mod)