public final class CoordinateFormatter extends Object
Constructor and Description |
---|
CoordinateFormatter(int numDecimals) |
Modifier and Type | Method and Description |
---|---|
String |
format(double x)
Formats a number with the configured number of decimals.
|
StringBuffer |
format(double x,
StringBuffer sb)
Formats a number with the configured number of decimals
|
int |
getMaximumFractionDigits()
Returns the maximum number of digits allowed in the fraction portion of a number.
|
boolean |
isForcedDecimal()
Returns the force decimal flag, see
setForcedDecimal(boolean) |
boolean |
isPadWithZeros() |
void |
setForcedDecimal(boolean forcedDecimal)
When set to true, forces decimal representation of numbers, otherwise allows scientific
notation too (for very large of very small numbers).
|
void |
setMaximumFractionDigits(int maxDigits) |
void |
setPadWithZeros(boolean pad) |
public String format(double x)
format(double, StringBuffer)
against a re-used StringBufferx
- sb
- public StringBuffer format(double x, StringBuffer sb)
x
- sb
- public int getMaximumFractionDigits()
public void setMaximumFractionDigits(int maxDigits)
public boolean isForcedDecimal()
setForcedDecimal(boolean)
public boolean isPadWithZeros()
public void setForcedDecimal(boolean forcedDecimal)
forcedDecimal
- public void setPadWithZeros(boolean pad)
Copyright © 1996–2019 Geotools. All rights reserved.