stevedlawrence opened a new pull request, #1138:
URL: https://github.com/apache/daffodil/pull/1138

   > [!NOTE]
   > I've marked this as a RFC/Draft--although I think this changes the 
behavior to what a user would expect with this specific type of 
textNumberPattern, it is behavior that is not specified by the DFDL 
specification
   
   If textNumberPattern specifies a pad character before the number pattern and 
without a positive prefix, then ICU defaults to a pad position of 
PAD_BEFORE_PREFIX with no way to change it with just the pattern. This is 
reasonable for most cases, like when the pad character is a space. However, if 
the pad character in textNumberPattern is '0', then negative numbers are padded 
with a '0' before the negative sign. For example, a pattern of "*0####0" 
unparses -123 to "0-123". This is very unlikely to be what the user wants with 
this pattern.
   
   So in this very specific case, we change the pad position to 
PAD_AFTER_PREFIX so the zero pad character appears after the negative sign, 
e.g. "-0123".
   
   If a user really wants '0' characters to the left of the negative sign, they 
can use textPadKind/textTrimKind and textNumberPadCharacter to uses Daffodils 
padding logic.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to