When it comes to formatting decimals in java there is one approach i know of
NumberFormat formatter = new DecimalFormat("#0.00");
but this is not working if you may have values such as
0.0000054654654 or similar
in that case you'll just get
0.00
while more logically it would make sence to print
0.0000054 (or maybe 0.0000055)
I wonder if there is already a solution for this? or i have to implement custom formatter?
examples that might be there
1.1 -> 1.100 0.00000011111 -> 0.000000111
you can see that instead of hardcoding how many digits after decimal point we want, we need to tell how many digits we want after first digit... (roughly)