Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java double to string fixed precision

Double toBeTruncated = new Double("3.5789055");

Double truncatedDouble = BigDecimal.valueOf(toBeTruncated)
    .setScale(3, RoundingMode.HALF_UP)
    .doubleValue();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #double #string #fixed #precision
ADD COMMENT
Topic
Name
9+9 =