[DFDL-WG] Action 185: Text number rounding and ICU
Steve Hanson
smh at uk.ibm.com
Tue Dec 11 05:53:55 EST 2012
As described in action 185, the DFDL spec behaviour for the DFDL
properties that control text number rounding was derived from the
documented behaviour for ICU4J. However the documentation is not correct
and the ICU4J behaviour is as described for ICU4C. An ICU ticket was
raised to clarify the position, and the intended behaviour is the observed
behaviour. That affects the DFDL text number rounding properties as
follows:
textNumberRounding
Enum
Specifies how rounding is controlled during unparsing.
Valid values ‘pattern', 'explicit'
When dfdl:textNumberRep is 'standard' this property only applies when
dfdl:textStandardBase is 10.
If 'pattern' then rounding takes place according to the pattern. A
rounding increment may be specified in the dfdl:textNumberPattern using
digits '1' though '9', otherwise rounding is to the width of the pattern.
The rounding mode is always 'roundHalfEven'.
If 'explicit' then the rounding increment is specified by the
dfdl:textNumberRoundingIncrement property, and any digits '1' through '9'
in the dfdl:textNumberPattern are treated as digit '0'. The rounding mode
is specified by the dfdl:textRoundingMode property.
To disable rounding, use 'explicit' in conjunction with 'roundUnnecessary'
for the dfdl:textNumberRoundingMode. If rounding is disabled then any
excess precision is treated as a processing error.
Annotation: dfdl:element, dfdl:simpleType
textNumberRoundingMode
Enum
Specifies how rounding occurs during unparsing, when
dfdl:textNumberRounding is 'explicit'.
When dfdl:textNumberRep is 'standard' this property only applies when
dfdl:textStandardBase is 10.
To switch off rounding, use 'roundUnnecessary'.
Valid values ‘roundCeiling’, ‘roundFloor’, ‘roundDown’, ‘roundUp’,
‘roundHalfEven’, ‘roundHalfDown’, ‘roundHalfUp', 'roundUnnecessary'
Annotation: dfdl:element, dfdl:simpleType
textNumberRoundingIncrement
Double
Specifies the rounding increment to use during unparsing, when
dfdl:textNumberRounding is 'explicit'.
When dfdl:textNumberRep is 'standard' this property only applies when
dfdl:textStandardBase is 10.
To switch off rounding, use 0.0.
A negative value is a schema definition error.
Annotation: dfdl:element, dfdl:simpleType
Regards
Steve Hanson
Architect, Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh at uk.ibm.com
tel:+44-1962-815848
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20121211/41297bee/attachment.html>
More information about the dfdl-wg
mailing list