Question about unparsing with dfdl:textNumberPattern "#.##" vs. "0.##"

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

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@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
participants (1)
-
Mike Beckerle