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

[ERTP] decimal property #119

Closed
DavidBruant opened this issue Dec 3, 2019 · 2 comments · Fixed by #1964
Closed

[ERTP] decimal property #119

DavidBruant opened this issue Dec 3, 2019 · 2 comments · Fixed by #1964
Assignees
Labels
ERTP package: ERTP

Comments

@DavidBruant
Copy link
Contributor

follow up to Agoric/documentation#65 (comment)_

If you look at Ethereum's ERC20 tokens, they all have a field called decimal which describes how many places the decimal should be moved over for display purposes.

In ERTP, the extents are the smallest denomination of digital asset such that it is always a natural number. We don't currently have a place to put information about how it should be represented to the user, like decimal but we do need it.

I imagine a good place for this could be the mint configuration. It's not clear to me how exactly yet
But it could take the form of a stringify function that takes units as argument and would return a string representing the units. Example: units representing dollars would be an object with the extent expressed as cents (like the number 1234 for $12.34) and the stringify function would return the string 12.34

@erights
Copy link
Member

erights commented Dec 3, 2019

How does Intl (internationalization API) handle formatting of currency amounts?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat

@DavidBruant
Copy link
Contributor Author

I've used it only a little, but i've had a really good experience with it
That said, i'm not sure this is directly relevant to the problem of this issue

This issue is about the fact that if you create a currency with ERTP, you represent it only with natural numbers (like cents for dollars or satoshi for bitcoins), but ERTP does not allow to configure what a canonical string representation for the currency would be. This is where allowing mint authors to provide a stringify function would come handy

Where i see the connection is that it can be recommanded to mint authors to use Intl/NumberFormat to write their formatting functions. But ERTP still needs to provide a way to share the stringify function so that an application knows how to represent a payment or purse object

@warner warner added the ERTP package: ERTP label Dec 4, 2019
@katelynsills katelynsills changed the title [ERTP] Representing non-natural number currencies [ERTP] Add a stringify function to ERTP for UI representation of extents Jan 10, 2020
@katelynsills katelynsills changed the title [ERTP] Add a stringify function to ERTP for UI representation of extents [ERTP] Add a stringify function for UI representation / decimal property Oct 21, 2020
@katelynsills katelynsills self-assigned this Nov 2, 2020
@rowgraus rowgraus added the Beta label Nov 2, 2020
@rowgraus rowgraus added this to the Chainlink Hackathon milestone Nov 2, 2020
@katelynsills katelynsills changed the title [ERTP] Add a stringify function for UI representation / decimal property [ERTP] decimal property Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ERTP package: ERTP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants