Answers for "return float with 2 decimals java"

1

how to get 2 decimal places in java

total = (double) 100 / listMember.size();
DecimalFormat df = new DecimalFormat("#.##");
String dx = df.format(total);
total = Double.valueOf(dx);
Posted by: Guest on July-31-2021
0

java integer division to float

instead of writing
v = s/i (this does integer division)
write v = (float)s / i
Posted by: Guest on September-06-2020

Code answers related to "return float with 2 decimals java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language