Example usage for org.apache.commons.lang3.math Fraction add

List of usage examples for org.apache.commons.lang3.math Fraction add

Introduction

In this page you can find the example usage for org.apache.commons.lang3.math Fraction add.

Prototype

public Fraction add(final Fraction fraction) 

Source Link

Document

Adds the value of this fraction to another, returning the result in reduced form.

Usage

From source file:org.zkoss.ganttz.util.Interval.java

public Fraction getProportion(DateTime date) {
    Days fromStartToDate = Days.daysBetween(startInclusive, date.toLocalDate());
    Fraction result = Fraction.getFraction(fromStartToDate.getDays(), this.daysBetween.getDays());

    try {/*from  ww  w.ja  va  2  s.  co m*/
        return result.add(inTheDayIncrement(date));
    } catch (ArithmeticException e) {
        return result;
    }
}