{"record":{"id":"488510fa53318f8c","repo":"OpenRefine/OpenRefine","slug":"could-not-parse-val-as-a-floating-point-number","errorCode":null,"errorMessage":"Could not parse '{val}' as a floating point number.","messagePattern":"Could not parse '(.+?)' as a floating point number\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"server/src/com/google/refine/Configurations.java","lineNumber":69,"sourceCode":"        final String val = get(name);\n        return (val == null) ? def : Boolean.parseBoolean(val);\n    }\n\n    public static int getInteger(final String name, final int def) {\n        final String val = get(name);\n        try {\n            return (val == null) ? def : Integer.parseInt(val);\n        } catch (NumberFormatException e) {\n            throw new RuntimeException(\"Could not parse '\" + val + \"' as an integer number.\", e);\n        }\n    }\n\n    public static float getFloat(final String name, final float def) {\n        final String val = get(name);\n        try {\n            return (val == null) ? def : Float.parseFloat(val);\n        } catch (NumberFormatException e) {\n            throw new RuntimeException(\"Could not parse '\" + val + \"' as a floating point number.\", e);\n        }\n    }\n\n}\n","sourceCodeStart":51,"sourceCodeEnd":74,"githubUrl":"https://github.com/OpenRefine/OpenRefine/blob/a946177e049f3b0644261661db36cbb0c81ccf8a/server/src/com/google/refine/Configurations.java#L51-L74","documentation":"Configurations.getFloat reads a configuration value and parses it with Float.parseFloat; when the value is present but not a valid float it wraps the NumberFormatException in a RuntimeException with this message. Like getInteger, it exists to convert external string configuration into typed server settings with a clear failure mode.","triggerScenarios":"Setting a configuration property consumed via Configurations.getFloat(name, def) to a non-numeric string, e.g. TIMEOUT=slow or a value with a comma decimal separator like 0,5 (Java expects 0.5).","commonSituations":"Locale-style decimal commas in config files; unit suffixes ('1.5s', '90%'); typos or leftover placeholder text ('TODO', 'N/A') in numeric settings.","solutions":["Correct the property value to a plain Java-parseable float using '.' as the decimal separator, e.g. 0.5.","Strip units, percent signs, spaces, and quotes from the value.","Remove the property so the documented default is used instead.","Validate all numeric refine.ini entries after edits before restarting the server."],"exampleFix":"# before (refine.ini)\nSOME_RATIO=0,5\n# after\nSOME_RATIO=0.5","handlingStrategy":"validation","validationCode":"String val = System.getProperty(name);\nif (val != null) { try { Float.parseFloat(val); } catch (NumberFormatException e) { throw new IllegalStateException(name + \" must be a float, got: \" + val); } }","typeGuard":"boolean isFloatString(String s) { try { Float.parseFloat(s); return true; } catch (NumberFormatException e) { return false; } }","tryCatchPattern":"try { float f = Configurations.getFloat(name, def); } catch (RuntimeException e) { if (e.getMessage().contains(\"floating point\")) { f = def; } else { throw e; } }","preventionTips":["Use '.' as the decimal separator; avoid locale decimal commas","Strip units and symbols (s, %, M) from numeric config values","Rely on defaults by removing invalid properties instead of leaving placeholder text","Re-validate all numeric settings after any config edit"],"tags":["config","server","float-parse","startup"],"backgroundTag":"invalid-config-value","analyzedSha":"a946177e049f3b0644261661db36cbb0c81ccf8a","analyzedAt":"2026-09-08T10:21:27.735Z","contentChangedAt":"2026-09-08T10:21:27.735Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}