My question is basically the following:
When I use a value with BigDecimal, how do I append zeros in front of a random number? Say I want to have a number <10 following an entirely random pattern. Now i want to add zeros in front of the number, so the actual amount adds up to 10 numbers.
Here's an example: BigDecimal num = new BigDecimal(2353);
Now I want to have that ouput: 0000002353
Is there a function that appends numbers to a BigDecimal type? I couldn't find any.
I tried using a while loop that checks whether the number is less than ten. But I don't understand the Big Decimal well enough to actually compare integral values to the BigDecimal types. Thanks for any help in advance!