[DFDL-WG] Question about unparsing with dfdl:textNumberPattern "#.##" vs. "0.##"

Mike Beckerle mbeckerle at apache.org
Thu Oct 26 15:50:02 PDT 2023


I submitted ICU bug report:
https://unicode-org.atlassian.net/browse/ICU-22558. I'll report back on
what happens.

On Thu, Oct 26, 2023 at 6:21 PM Mike Beckerle <mbeckerle at apache.org> wrote:

>
> These textNumberPatterns behave the same as far as I can tell.
>
> I'd expect them to be different when unparsing.
>
> When unparsing decimal number value 0.12 I'd expect....
>
> textNumberPattern="0.##" to create a 4 character representation "0.12"
>
> because one digit left of the decimal point is required.
>
> But I expect...
>
> textNumberPattern="#.##" to create a 3-character representation ".12"
>
> because the digit to the left of the decimal point is optional and the
> whole integer part is zero and so should be suppressed.
>
> Isn't that the point of "#" versus "0" as a digit indicator in the pattern?
>
> That's not what happens though. I get "0.12" from either textNumberPattern
> pattern.
>
> Is this a bug?
>
> Mike Beckerle
> Apache Daffodil PMC | daffodil.apache.org
> OGF DFDL Workgroup Co-Chair | www.ogf.org/ogf/doku.php/standards/dfdl/dfdl
> Owl Cyber Defense | www.owlcyberdefense.com
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/html
Size: 2574 bytes
Desc: not available
URL: <https://lists.ogf.org/pipermail/dfdl-wg/attachments/20231026/f4274516/attachment.txt>


More information about the dfdl-wg mailing list