in my code i use integers multiplied by 100 as decimals (0.1 is 10 etc). Can you help me to format output to show it as decimal?
Based on another answer, using BigDecimal, this also works:
BigDecimal v = BigDecimal.valueOf(10,2);
System.out.println(v.toString());
System.out.println(v.toPlainString());
System.out.println(String.format("%.2f", v));
System.out.printf("%.2f\n",v);
Or even your good old DecimalFormat will work with BigDecimal:
DecimalFormat df = new DecimalFormat("0.00");
System.out.println(df.format(v));