Can't see enough decimals
xerobia-test opened this issue · 6 comments
I typically work with small amounts of nano, so there are a lot of 0's e.g. 0.0000283 NANO.
Your script is great but only provides up to 3 decimal points of resolution. This means sometimes my account has some nano but I don't know if it actually does AND I don't know how much there is. I just guess which is annoying.
Can you allow for an optional flag that specifies the number of decimal places to display the account balances to? 3 is a good default but it's nice to have more.
Example usage: atto -a 4 b 10
atto - 4th account - balance - display balance to 10 dp
Good point, small amounts should probably be handled somehow.
I'm always hesitant to make the interface more complicated, so I don't like the idea of adding a new parameter for the desired precision.
I had a different idea: How about displaying exactly as many decimal places as necessary to provide full precision? I have implemented this on this branch: https://github.com/codesoap/atto/tree/full_precision. Could you try this and tell my what you think about it? I'll also think about this for a little while myself...
Yes, good point. I don't think complicating the user interface is good either. I think your idea is good. It reminds me of what the Natrium wallet does.
However, I haven't had the chance to test it yet. Hopefully later today.
One think I'm worried about is what if I have 0.00000000000000000000000001 nano left over? Also sometimes a transaction for 0.0001 nano might become 0.000099999999999999999999 nano.
Natrium doesn't seem to render that tiny amount and rounds. But should it?... I'm not sure on this.
One think I'm worried about is what if I have 0.00000000000000000000000001 nano left over?
What worries you about this? Are you worried that the displayed amount will always have a lot of decimal places? You could just send these tiny amounts to a "loose change" wallet, so that they don't annoy you in your daily wallet (or just burn them with pass nano | atto s 0.00000000000000000000000001 $(atto n | atto a)
).
Also sometimes a transaction for 0.0001 nano might become 0.000099999999999999999999 nano.
What do you mean by this? atto will never change an amount even the slightest bit. Are there other wallets which do? I think you should file a bug report, if so.
It might be intimidating to a new user to see so many zeroes.
I know that atto and most wallets don't change it, but I've had instances where I've been sent 1 raw less than what was intended. I don't think it was out of malice - just so weird quirk somewhere.
Not sure if there are very significant issues though.
It might be intimidating to a new user to see so many zeroes.
Yeah, I agree, but I think I prefer correctness over "intimidation factor". I want atto to be usable in scripts as much as possible and, for example, implementing a wallet-sweep-script using atto would only be possible, if atto shows all digits.