I'm having some issues with my game and it's numbers.
I want to create a balance that has 4 decimals. So my number start with 0.0000.
As 1.0000 stands for "1" and 12.3000 stands for "12.3".
At this moment i use round(N * 10000) / 10000 to show my numbers like 0.001 but i can't fix the fourth 0.
Also some of my objects have the price of 0.0001 which will not be possible. I can set a instance variable up to 3 decimals. So 0.001 is possible but 0.0001 is not.
My exact goal is:
Start out with 0.0001
Able to display 1.0000 as 1.0000
Able to display 10.0000 as 10.0000
Able to display 100.0000 as 100.0000
Able to display 1000.0000 as 1K
Able to display 1200.0000 as 1.2K
Able to display 10000.0000 as 10K
Able to display 12000.0000 as 12K
Able to display 100000.0000 as 100K
Able to display 120000.0000 as 120K
Able to display 1000000.0000 as 1M
Able to display 1200000.0000 as 12M
Any one here able to help me into the right direction?