For my use case I'm pretty printing spans rounded up to the minute. However when a zero span is printed it shows up in seconds instead and the only way that I see to influence that is to mark a unit as fractional.
In an ideal scenario a rounded span could propagate its lower limit to the printer to avoid having to repeat the lower bound multiple times. But I understand that this would require to store the information in the span to handle the zero case, which is probably not desirable.
There could be a method to the printer to specify the zero value unit. But this could potentially lead to mismatches between the rounded span's lowest unit and the zero value unit and it would also require the user to specify the lowest unit twice, once for the rounding and once for the printer.
Maybe a method could be added to the printer to apply the rounding to the span and print it. That would allow the zero value to be printed in the same unit as the rounding.
What are your thoughts on this? Are there better solutions for this use case?
For my use case I'm pretty printing spans rounded up to the minute. However when a zero span is printed it shows up in seconds instead and the only way that I see to influence that is to mark a unit as fractional.
In an ideal scenario a rounded span could propagate its lower limit to the printer to avoid having to repeat the lower bound multiple times. But I understand that this would require to store the information in the span to handle the zero case, which is probably not desirable.
There could be a method to the printer to specify the zero value unit. But this could potentially lead to mismatches between the rounded span's lowest unit and the zero value unit and it would also require the user to specify the lowest unit twice, once for the rounding and once for the printer.
Maybe a method could be added to the printer to apply the rounding to the span and print it. That would allow the zero value to be printed in the same unit as the rounding.
What are your thoughts on this? Are there better solutions for this use case?