Add method to round DateTimeComponents
As a user I would like to write rounded date times as a string in a custom format. I've seen other users on the forums with this desire as well. This is needed so I don't end up with invalid times in the output, e.g. 60.0 seconds when there is not a leap second, and because the Java decimal formatting routines round.
One solution is to add a method to round a DateTimeComponents
to a specified number of digits in the fractional seconds. There is already an implementation in DateTimeComponents.toStringWithoutUtcOffset(int, int)
. Perhaps adding a convenience method to AbsoluteDate
would be useful too. E.g. getRoundedComponents(TimeScale, int)
.