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

Update NanoAmount/NanoUnit friendly amount to support new currency symbol Ӿ #12

Open
bwebster4 opened this issue Nov 15, 2021 · 4 comments

Comments

@bwebster4
Copy link

Currently, when calling toString() on a NanoAmount, it produces something like "1 NANO". I am proposing that it should now return something more along the lines of "Ӿ1" or "Ӿ 1". This should be a pretty easy change, but it does require some awkwardness around appending or prepending the unit description.

In my opinion, NanoUnit needs a more general update to reflect the move away from the terms Gnano, NANO, knano, nano, mnano, etc. These days, there are just two common denominations, nano and raw. NANO, Nano, and nano mean the same thing now. I think we could get rid of these other denominations, and just use nano and raw. And then if nano, prepend "Ӿ", and if raw append "raw". Alternatively, it might be best to just leave off any sort of label, and leave that up to the user of the library.

I'd be happy to work on this myself and make a pull request. If work on this is already begun, please let me know, and if anyone has opinions on this I'd be happy to hear them.

@koczadly
Copy link
Owner

Thanks for submitting an issue! No need to make the change yourself, I've actually already done this months back (albeit on a local branch). The older units have also been deprecated, but kept for backwards compatibility.

I'll try push them all to a dev branch for the time being, but I still have a few things I wanna figure out before I release a new version, I've got a bunch of local changes stacked up - I'm trying to bundle as many (possibly breaking) changes all at once for version 3, and hopefully segment the library into different lightweight maven artifacts while I'm at it.

@koczadly
Copy link
Owner

If I'm gonna make a bunch of breaking changes I'll probably just remove the deprecated enums, and rename MEGA to NANO.

@bwebster4
Copy link
Author

Awesome, looking forward to that update! Thanks for your work on this library.

@koczadly
Copy link
Owner

No worries at all bro! If you have any suggestions or criticisms of it in it's current state, please do let me know! I'm always looking to improve, and this will probably be the last set of breaking changes I do given that many other projects are now dependant on this library.

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

No branches or pull requests

2 participants