core: Time::RoundTo (unit) to round Time to any unit

Merge of !475
This commit is contained in:
Peter D. Barnes, Jr
2020-11-16 17:52:41 -08:00
committed by Tom Henderson
parent eb432c90a5
commit 2340fcf260

View File

@@ -546,6 +546,16 @@ public:
}
/**@}*/ // Get Times as Numbers in Specified Units
/**
* Round a Time to a specific unit.
* Rounding is to nearest integer.
* \return The Time rounded to the specific unit.
*/
Time RoundTo (enum Unit unit) const
{
return From (this->To (unit).Round (), unit);
}
/**
* Attach a unit to a Time, to facilitate output in a specific unit.
*