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

we should have a nice way to print and parse different quantities of FIL #559

Closed
phritz opened this issue Jun 16, 2018 · 1 comment
Closed
Assignees

Comments

@phritz
Copy link
Contributor

phritz commented Jun 16, 2018

Prior to #340 we represented token amounts as a bigint quantity of filecoin. #340 involved representing token quantities in attofilecoin (10**-18) (and serializing them in scientific notation, but that's not important here). Any time token amounts are written to or parsed from strings they are done so as units of filecoin, not attofilecoin. Obviously, that loses precision so this is a temporary thing. We'll need to teach token amounts to stringify to and parse from an ergonomic string representation.

Where to start:

  • Change AttoFIL.String() to stringify to the number of attofilecoin, not filecoin, and AttoFIL's (un)marshaljson to see call sites

What's required is a way to print and parse quantities of attofilecoin that are user-friendly. For example print them as fixed point decimal number of filecoin with up to 18 digits after the point, but without needless precision.

@lkowalick
Copy link
Contributor

lkowalick commented Aug 14, 2018

@phritz So this issues seems to involve two things:

  1. Marshal/Unmarshal Filecoin as strings that are integer amounts of AttoFIL internally and make the system work with this assumption.
  2. Develop and use an "ergonomic" representation of AttoFIL that will be used for user-facing concerns.

I understand (1) pretty well, but I'm not exactly sure when (2) should come into play. I assume "user-facing" means CLI/Filecoin explorer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants