Class Rounding

java.lang.Object
com.portal.common.Rounding

public class Rounding extends Object
This utility class implements a common set of "rounding" methods that are frequently used by billing, rating, and pricing.
Version:
$Id: Rounding.java,v 1.4 1998/07/10 18:48:09 lussie Exp $
Author:
Jon Sorensen
  • Constructor Details

    • Rounding

      public Rounding()
  • Method Details

    • roundTo12AMApplyHourOffset

      public static Date roundTo12AMApplyHourOffset(Date time, int hourOffset)
      Adjust the time value to 12 AM and then apply the specified offset (which is in hours). If the hour offset is greater than the hour in the specified time then roll back to the previous day.

      Parameters:
      time - the time value to adjust
      hourOffset - the offset (in hours from 0 to 23) to apply to the specified time. day.
      Returns:
      the specified time with the hour offset applied to it. Here are some examples:
      • time = 01/05/2001;9:59:67, hourOffset = 10, return 01/04/2001;10:00:00
      • time = 01/05/2001;10:59:21, hourOffset = 10, return 01/05/2001;10:00:00