Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify units of currency to be used for the AmountString field type #652

Closed
mattyp opened this issue Jul 14, 2024 · 7 comments
Closed

Specify units of currency to be used for the AmountString field type #652

mattyp opened this issue Jul 14, 2024 · 7 comments
Labels
Non-breaking change A change that is not expected to result in a new endpoint version. Operational Proposal made The DSB has proposed a specific change to the standards to address the change request
Milestone

Comments

@mattyp
Copy link

mattyp commented Jul 14, 2024

Description

As referenced in issue #644, there is currently ambiguity as to the units of currency to be used for the AmountString type. This ambiguity is exposed within the Energy sector that frequently quotes amounts in fractional units (i.e. cents) rather than main units (i.e. dollars). As a result, some DHs are populating Energy sector payload values with main units (e.g. dollars) while others are populating with fractional units (e.g. cents).

While main units makes intuitive sense within the Banking sector and there are suggestions based on the field type of CurrencyString that perhaps all amounts are to be in main units of the currency being used, it is sufficiently ambiguous within a sector that frequently uses fractional units for there to be incongruence between implementations.

Intention and Value of Change

Explicitly specifying the units of currency as part of the standards will help with consistency and quality of data for a number of payloads within the Energy sector. This will subsequently ensure accuracy for data recipient producing consumer products who otherwise currently need to rely on heuristics to best-guess the units of currency in payloads.

Area Affected

The AmountString definition in https://consumerdatastandardsaustralia.github.io/standards/#common-field-types, is currently:

A string representing an amount of currency.

  • A positive, zero or negative number
  • Negative numbers identified with a ‘-‘
  • Currency symbols MUST NOT be supplied
  • At least 1 and up to a total of 16 significant digits before decimal point
  • Minimum 2 digits following a decimal point (more digits allowable but only if required)
  • No additional formatting, eg thousand separating commas

Within this definition there is no explicit reference to currency units to be used. There is no other explicit reference in the standards outside of the field type that I can find, either.

Change Proposed

There may be more appropriate places for the specification of unit of currency, but it logical and has some precedence with RateString to specify this as part of the type definition for AmountString. For example:

A string representing a monetary amount in main currency units with fractional units after a decimal point (e.g., if working with Australian dollars: "123.45" for one hundred twenty-three dollars and forty-five cents).
- A positive, zero or negative number
- Negative numbers identified with a ‘-‘ prefix
- Currency symbols MUST NOT be supplied
- At least 1 and up to a total of 16 significant digits before decimal point
- Minimum 2 digits following a decimal point (more digits allowable but only if required)
- No additional formatting, eg thousand separating commas

The two updates to the definition in this example are:

A string representing a monetary amount in main currency units with fractional units after a decimal point (e.g., if working with Australian dollars: "123.45" for one hundred twenty-three dollars and forty-five cents).

and

- Negative numbers identified with a ‘-‘ prefix

DSB Proposed Solution

The current DSB proposal for this issue is in #652 (comment)

@perlboy
Copy link

perlboy commented Aug 7, 2024

I think where we got to as a suggestion was to tweak this as:

A string representing a monetary amount with fractional units after a decimal point (e.g., if working with Australian dollars: "123.45" for one hundred twenty-three dollars and forty-five cents).
- Negative numbers identified with a ‘-‘ prefix

Additionally add a clarifying statement to state where dollar values are mentioned they are assumed to be in AUD.

@mattyp
Copy link
Author

mattyp commented Aug 7, 2024

Any particular reason for not including the clarifying "main currency units" or the negative value "prefix" in the proposal?

@perlboy
Copy link

perlboy commented Aug 7, 2024

Any particular reason for not including the clarifying "main currency units" or the negative value "prefix" in the proposal?

Mainly to work around potentially non AUD values questions (ie. should it be translated to AUD or not). Sorry negative is included in my alignment just wasn't discussed too much.

@mattyp
Copy link
Author

mattyp commented Aug 7, 2024

Ahh, ok, because "main" could be construed as "AUD"? Currencies have a "main" portion (eg dollars, pound, sterling) and a "fractional" portion (eg cents, penny), and the original proposal was in this context.

Maybe we drop "main", eg "... a monetary amount in currency units..." just so it explicitly references units still.

@CDR-API-Stream
Copy link
Collaborator

Based on the discussion and feedback on this issue thus far, the DSB is proposing to update the description of AmountString to the following:

A string representing a monetary amount in currency units with fractional units after a decimal point (e.g., if working with Australian dollars: "123.45" represents one hundred twenty-three dollars and forty-five cents).
- A positive, zero or negative number
- Negative numbers identified with a ‘-‘ prefix
- Currency symbols MUST NOT be supplied
- At least 1 and up to a total of 16 significant digits before decimal point
- Minimum 2 digits following a decimal point (more digits allowable but only if required)
- No additional formatting, eg thousand separating commas
- Assumed to be in AUD unless specified otherwise

The three updates specifically are:

  1. A string representing a monetary amount in currency units with fractional units after a decimal point (e.g., if working with Australian dollars: "123.45" for one hundred twenty-three dollars and forty-five cents).
  2. Negative numbers identified with a ‘-‘ prefix
  3. Assumed to be in AUD unless specified otherwise

The changes would be considered non-breaking.

Feedback on the proposed change is welcome.

@CDR-API-Stream CDR-API-Stream added the Proposal made The DSB has proposed a specific change to the standards to address the change request label Aug 20, 2024
@CDR-API-Stream
Copy link
Collaborator

The proposed change has been staged for review.

@nils-work nils-work added the Non-breaking change A change that is not expected to result in a new endpoint version. label Sep 2, 2024
@nils-work
Copy link
Member

Incorporated into Standards v1.32.0.

@github-project-automation github-project-automation bot moved this from Awaiting Chair Approval to Done in Data Standards Maintenance Oct 22, 2024
@nils-work nils-work added this to the v1.32.0 milestone Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Non-breaking change A change that is not expected to result in a new endpoint version. Operational Proposal made The DSB has proposed a specific change to the standards to address the change request
Projects
Status: Done
Development

No branches or pull requests

4 participants