The list of methods to do Float Number Parse are organized into topic(s).
double
readFloatFromString(String inStr) Read float data from a string
DecimalFormat dformat = new DecimalFormat("#");
DecimalFormatSymbols dfs = new DecimalFormatSymbols();
dfs.setDecimalSeparator('.');
dformat.setDecimalFormatSymbols(dfs);
String trimStr = inStr.trim();
if (trimStr.startsWith("+")) {
trimStr = trimStr.substring(1);
ParsePosition pp = new ParsePosition(0);
Number num = dformat.parse(trimStr, pp);
if (null == num) {
throw new Exception("Invalid Float In TLE");
return num.doubleValue();
Object
tryParseFloat(String floatValue) try Parse Float
Object parsedValue;
try {
parsedValue = Float.parseFloat(floatValue);
} catch (NumberFormatException nfe) {
parsedValue = floatValue;
return parsedValue;
Float
tryParseFloat(String value) Try to parse the string as float or return null if failed
try {
return Float.parseFloat(value);
} catch (NumberFormatException e) {
return null;
boolean
tryParseFloat(String value) Returns whether or not the String can be parsed as an Float
try {
Float.parseFloat(value);
} catch (NumberFormatException ex) {
return false;
return true;
float[]
tryParseFloats(String[] in) Tries to parse an array of floats.
try {
return parseFloats(in);
} catch (NumberFormatException e) {
return new float[0];