Link to home
Start Free TrialLog in
Avatar of nphnhi
nphnhi

asked on

change double format

Hello everyone,
I have a double for ex: 1234.2345 -> I want to change to format: 1234.23 (it is also a double)?
Please help me
Thank you very much
ASKER CERTIFIED SOLUTION
Avatar of sciuriware
sciuriware

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sciuriware
sciuriware

            DecimalFormat fmt = new DecimalFormat("###0.##");

String out = fmt.format(value);
<*>
And back to double could be:
     double d = fmt.parse(out).doubleValue();
<*>