Created
October 12, 2016 18:47
-
-
Save rwoloszyn/2dd08a73273f369235739949c5a0365a to your computer and use it in GitHub Desktop.
Reduce decimal points number for double value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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