getDurationForPrecision static method
Implementation
static int getDurationForPrecision(int precision, double durationMs)
{
double numerator = durationMs;
if (precision != TimePrecision.DAYS) {
int previousPrecision = getPreviousPrecision(precision);
numerator = numerator % previousPrecision.toDouble();
}
return ( numerator / precision.toDouble() ).floor();
}