Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reduce decimal points number for double value
DecimalFormat df = new DecimalFormat("#.####");
df.setRoundingMode(RoundingMode.CEILING);
double newLat = Double.valueOf(df.format(coordinates.latitude));
double newLong = Double.valueOf(df.format(coordinates.longitude));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment