List of usage examples for org.apache.commons.math3.fraction BigFraction getNumeratorAsLong
public long getNumeratorAsLong()
Access the numerator as a long.
From source file:com.netflix.imfutility.util.ConversionHelper.java
/** * Converts the edit rate as a fraction instance to the edit rate form such as "50 1". * * @param editRate input//from w w w.j a va 2 s . c o m * @return output in a form "50 1" */ public static String toEditRate(BigFraction editRate) { return String.format("%s %s", String.valueOf(editRate.getNumeratorAsLong()), String.valueOf(editRate.getDenominatorAsLong())); }
From source file:com.netflix.imfutility.util.ConversionHelper.java
/** * Converts the edit rate as a fraction instance to the edit rate form such as "50/1". * * @param editRate input/*from www . j av a 2s . c o m*/ * @return output in a form "50/1" */ public static String toREditRate(BigFraction editRate) { return String.format("%s/%s", String.valueOf(editRate.getNumeratorAsLong()), String.valueOf(editRate.getDenominatorAsLong())); }