Are you able to use dfdl:binaryDecimalVirtualPoint? For example:

  <element name="cost" type="xs:decimal"
    dfdl:representation="binary"
    dfdl:binaryNumberRep="binary"
    dfdl:byteOrder="bigEndian"
    dfdl:lengthKind="explicit"
    dfdl:length="4"
    dfdl:lengthUnits="bytes"
    dfdl:binaryDecimalVirtualPoint="2" />

This parses a 4-byte binary integer that represents a cost in cents. The binaryDecimalVirtualPoint="2" then shifts the decimal to the left by 2 so the value in the infoset becomes dollars and cents. For example, 12345 becomes 123.45

If you're looking for something different, can you give an example?

(I've CC'd you directly since you're not subscribed to the list. You may want to join to see any follow-up discussion.)


On 2025/10/16 11:24:13 Sean Callahan wrote:
Good Morning Folks,

If it hasn’t already been suggested, a fixed-point (vs floating-point)
layer would be an excellent addition to the distribution. Currently, the
only alternative is hidden groups, which isn’t intuitive and quickly
clutters a schema.

Thanks,

Sean Callahan

Reply via email to