[DFDL-WG] ICU and rounding for fractional seconds

Mike Beckerle mbeckerle.dfdl at gmail.com
Fri Apr 12 10:51:38 EDT 2013


Steve Lawrence on the Daffodil team has been implementing the date & time
features. He has identified this issue:

ICU doesn't support rounding, in fact they explicitly state rounding is not
performed. From the javadoc:

FieldPosition selector for 'S' field alignment, corresponding to the
Calendar.MILLISECOND field. Note: Time formats that use 'S' can display a
maximum of three significant digits for fractional seconds, corresponding
to millisecond resolution and a fractional seconds sub-pattern of SSS. If
the sub-pattern is S or SS, the fractional seconds value will be truncated
(not rounded) to the number of display places specified. If the fractional
seconds sub-pattern is longer than SSS, the additional display places will
be filled with zeros.

Are we reading the DFDL spec right? In regards to fractional seconds, it
says:

Round up rounding must occur when converting between external and internal
representations.

Does this mean that a time of 01:02:03.0019 should be represented as
01:02:03.002 in the infoset rather than 01:02:03.001? I don't think ICU
supports that, and I thought DFDL attempted to fit as closely with ICU as
possible, so this seems an odd change from ICU.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20130412/a59fc09f/attachment.html>


More information about the dfdl-wg mailing list