formatCurrentPrecision method
- @override
- @protected
- StringJoiner sj,
- int lastPrecision,
- int currentPrecision,
- double durationMs,
override
Return value indicates whether to stop the loop
Implementation
@override
@protected bool formatCurrentPrecision(StringJoiner sj, int lastPrecision, int currentPrecision, double durationMs)
{
// Show days or hours if at least one, otherwise skip.
if (currentPrecision >= TimePrecision.HOURS) {
if (durationMs < currentPrecision) {
return false; // Skip if not at least 1.
}
}
sj.add( getDurationForPrecision(currentPrecision, durationMs).toString() );
// Handles all.
sj.add(" ");
sj.add( getUnitName(currentPrecision) );
sj.add(" ");
return false; // Continue loop.
}