Hi Mike,

  *   Use 0 instead of # for the rightmost two.

I tried that:

<xs:element name="price" type="xs:decimal"
    dfdl:textStandardDecimalSeparator="."
    dfdl:textNumberPattern="####.00" />

It gave the same result (the .00 is removed):

5000.00 --> parse --> 5000

Thoughts?

/Roger

From: Mike Beckerle <[email protected]>
Sent: Monday, December 3, 2018 9:21 AM
To: [email protected]
Subject: Re: How to retain the digits to the right of the decimal point?

Use 0 instead of # for the rightmost two. In a pattern, a zero denotes any 
digit. A # denotes an optional digit.


-------- Original message --------
From: "Costello, Roger L." <[email protected]<mailto:[email protected]>>
Date: 12/3/18 8:46 AM (GMT-05:00)
To: [email protected]<mailto:[email protected]>
Subject: How to retain the digits to the right of the decimal point?

Hello DFDL community,

My input contains decimal values such as: 2999.99 and 5000.00

When I parse my input, the .00 gets removed, e.g.,

5000.00 --> parse --> 5000

But the .99 is not removed, e.g.,

2999.99 --> parse --> 2999.99

I want to retain the two digits to the right of the decimal point, even if they 
are 00

How to retain the digits? I thought this would do the job:

dfdl:textNumberPattern="####.##" />

However, that has no effect.

What's the right way to do it?

/Roger

Reply via email to