As mentioned above. I give one example, let's say all the test values are less than 1 but greater than 0.
- 0.12 (precision: 3, scale:2)
- 0.345 (precision: 4, scale:3)
- 0.6789 (precision: 5, scale:4)
how do i convert those value without hard-coding the scale and precision value.
- 0.12 -> 12
- 0.345 -> 345
- 0.6789 -> 6789
for 0.1 and 0.01 and 0.001 should get 1 (i know this i bad idea but i have been given sets of business rules of the software)
i prefer solution in java but if there is a math algorithm it is better. thanks.