Is there a way to handle NaN for float values when...
# klaxon
d
Is there a way to handle NaN for float values when parsing the json using klaxon? Currently getting
Pending exception java.lang.RuntimeException: Unexpected character at position 1023: 'n' (ASCII: 110)'
s
the JSON spec omits
NaN
,
+/-Inf
unfortunately
if your data source is emitting those tokens, then it’s out of spec and you may or may not want to replace it if you can
if not, you may need to perform a bit of search and replace with a suitable replacement value
k
Or write you own converter for float values.
d
OK thank you both