dcmjs-org/dcmjs

Length of Decimal String larger than 16 characters

Opened this issue · 0 comments

Given a Decimal String with the numerical value of 0.99990081787109 (Number), and writing it to a DICOM file, then the resulting string is 17 characters wide.

In DecimalString::formatValue (ValueRepresentation.js), the function toExponential() guarantee that the resulting string is maximum 16 characters wide. See https://github.com/dcmjs-org/dcmjs/blob/master/src/ValueRepresentation.js#L535C1-L545C6

We copied the behavior from pydicom to properly truncate the string and made a PR. See https://github.com/pydicom/pydicom/blob/main/src/pydicom/valuerep.py#L912