Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

round the value of 2 decimals in java

class round{
    public static void main(String args[]){

    double a = 123.13698;
    double roundOff = Math.round(a*100)/100; //put attention to the parenthesis.

    System.out.println(roundOff);
}
}
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #decimals #java
ADD COMMENT
Topic
Name
1+8 =