I am working on a method that will return a double with a new format settings.
For example:
public double reformatDouble (double num) {
...code that will refomat the double num to a (9.5) format
return num;
}
So if I call this method, I will receive the following results:
reformatDouble(0.0) --->> this will return a double of value '000000000.00000'
reformatDouble(5.0) --->> this will return a double of value '000000005.00000'
reformatDouble(19.567) --->> this will return a double of value '000000019.56700'
Is it possible to have a double that will output in this format?
I would appreciate any help on this!!
NOTE: I have seen suggestions on other threads on this, but all of them are returning a
String e.g. DecimalFormat.format().
However, I need to return a double. Is this possible?