I want to display only the mantissa of a number independently of what the exponent is.
12.4e-6 after formatting => 12.4
12.4e-12 after formatting => 12.4
To do the calculation manually is trivial. But the problem is that I need to use the class DeciamalFormat because I have to give it as argument to another class. I tried this:
DecimalFormat mFormat = (DecimalFormat) NumberFormat.getInstance();
mFormat.applyPattern("#.#E0");
if I remove the E symbol, the mantissa will not be calculated. is there any way using this DecimalFormat
to show only mantissa
?