java double to string fixed precision

Solutions on MaxInterview for java double to string fixed precision by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "java double to string fixed precision"
Amy
20 Jan 2017
1Double toBeTruncated = new Double("3.5789055");
2
3Double truncatedDouble = BigDecimal.valueOf(toBeTruncated)
4    .setScale(3, RoundingMode.HALF_UP)
5    .doubleValue();