
Mike I suspect that the statement about rounding of fractional seconds was introduced before the ICU behaviour was realised. We should go along with the ICU behaviour for ease of implementation. I'll raise at the next DFDL WG call, and get a clarification from ICU in the meantime. Regards Steve Hanson Architect, IBM Data Format Description Language (DFDL) Co-Chair, OGF DFDL Working Group IBM SWG, Hursley, UK smh@uk.ibm.com tel:+44-1962-815848 From: Mike Beckerle <mbeckerle.dfdl@gmail.com> To: dfdl-wg@ogf.org, Date: 12/04/2013 15:54 Subject: [DFDL-WG] ICU and rounding for fractional seconds Sent by: dfdl-wg-bounces@ogf.org 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. -- dfdl-wg mailing list dfdl-wg@ogf.org https://www.ogf.org/mailman/listinfo/dfdl-wg Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU