question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Decimal type does not allow to store some ISO20022 fields

See original GitHub issue

We’re having a hard time with differences in Decimal between DAML and other environments. In particular the usage of it in ISO20022 (yes - a big subject area, but stick with me here…). ISO20022 uses decimals in many contexts, but they are specializations of the most general xsd definition for the type DecimalNumber:

    <xs:simpleType name="DecimalNumber">
        <xs:restriction base="xs:decimal">
            <xs:fractionDigits value="17"/>
            <xs:totalDigits value="18"/>
        </xs:restriction>
    </xs:simpleType>

Example: https://www.iso20022.org/sites/default/files/documents/messages/sese/schemas/sese.023.001.09.xsd

  • How do we deal with scenarios that need > 10 decimal places
  • Less bounded decimals / dependent types like Decimal[28,8]? 😃
  • Should we consider using Sci notation instead
  • Note that the above XSD notation is different from SQL, in that the latter has a fixed fractional digits

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
raphael-speyer-dacommented, Jun 17, 2019

IIUC the schema means that their DecimalNumber has a max precision of 18, and max scale of 17, so we’d need to support.

[
  123456789012345678.0,
  0.12345678901234567,
  1.23456789012345678
] : [Decimal]
0reactions
gerolf-dacommented, Jan 13, 2020

This has been fixed by #2289.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MT541: (49) Field 90a: Price: Book/Lot Price - ISO 15022
The number of decimal digits in Price is not validated against the currency specified. Sign must be present when Price is negative. MT541:...
Read more >
ISO20022 standard Message Implementation
This mandatory field stores the transaction charges to be paid by the charge bearer. The data type is amount. 39. How to use...
Read more >
FINplus Standards Release 2022 Updated High-Level ...
This document describes the requested changes for messages in FINplus that may be updated for the next. Standards Release.
Read more >
ISO 20022-1:2013(en), Financial services
ISO shall not be held responsible for identifying any or all such patent rights. ISO 20022-1 was prepared by Technical Committee ISO/TC 68, ......
Read more >
Amendment – ISO20022.PLUS
Fields specifying a monetary amount with an implied currency should use a decimal type. Note that ISO20022-4:2013 disallows any currency in contradiction, and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found