I'm trying to format BigInteger numbers to a more humanly readable form
Examples:
1000 -> 1.000K
5821 -> 5.821K
10500 -> 10.500K
101800 -> 101.800K
2000000 -> 2.000M
7800000 -> 7.800M
92150000 -> 92.150M
123200000 -> 123.200M
1 000 000 000 000 000 000 -> 1.000E
1 000 000 000 000 000 000 000 -> 1.000Z
1 000 000 000 000 000 000 000 000 -> 1.000Y
611 781 555 431 000 000 000 000 000 -> 611.781Y
I saw a method using long values, but for my purpose long cannot store big enough values so I have to use BigInteger
s. How can I format it in such a way using BigInteger?
In my case, the max amount it is supposed to handle is:
1 000 000 000 000 000 000 000 000 000 and is formatted to 1.000B
EDIT
No, this is not a duplicate of this post. I have to use BigInteger for this to work and it has to be done using BigInteger. Long values(as the other post asks about) does not store big enough values compared to what i need