janoside / btc-rpc-explorer

Database-free, self-hosted Bitcoin explorer, via RPC to Bitcoin Core.
https://bitcoinexplorer.org
MIT License
1.58k stars 1.18k forks source link

Always show 0/4/8 decimal places on BTC amounts #441

Closed CeruleanRat closed 1 year ago

CeruleanRat commented 2 years ago

I got confused looking at the balance of a transaction because the eight decimal place was a 0 and wasn't shown, and I was assuming all eight were being shown so the amount seemed to be off by a factor of ten.

There's an example of this on https://bitcoinexplorer.org/tx/d90bfda13e6599cf595f3f43476074d717b6e166821e5ff22bfe4823ec113c63, where the 0th output shows a value of 0.0032015 BTC with seven decimal places. It also right-aligns so its seventh decimal place is in the same position as the eight decimal place on the numbers below it.

I think it would be neater to always use 0/4/8 (or maybe 0/2/4/8) decimal places for BTC amounts to make them easier to read consistently. For example:

3.1        shows as 3.10 or 3.1000
3.14       shows as 3.14 or 3.1400
3.141      shows as 3.1410
3.1415     shows as 3.1415
3.14159    shows as 3.14159000
3.141592   shows as 3.14159200
3.1415926  shows as 3.14159260
3.14159265 shows as 3.14159265
janoside commented 1 year ago

I think I like this hybrid approach. I'd be happy to consider any disagreement, but I like the balance - clean, easy display for values with fewer significant digits, and less confusion for situations like the one referenced (7 sig digits).