Convert Number in Java

Asked by At

I need help How to round number in java I have value 0.655308 then I wan to show to 65.53% I have value 1.0583104 then I wan to show 105.83 in power builder compute expression I use

 act_qty  *work_hour /
 if (on_hour < work_hour )  /
  sec_setm_gole_qty ,4)

and How to run in java Thanks for advanced

2 Answers

Community On

I would just multiple the value with 100

double roundedValue = value * 100;
System.out.printf("%.2f", roundedValue);
Benjamin Urquhart On