List of usage examples for org.apache.commons.lang3.math Fraction add
public Fraction add(final Fraction fraction)
Adds the value of this fraction to another, returning the result in reduced form.
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; } }