Skip to content

Commit

Permalink
[network] Fix NumberFormatException for ping when locale has comma as…
Browse files Browse the repository at this point in the history
… decimal separator (openhab#16636)

* fixing bug:
LatencyParser fails to parse ping times on systems with comma (,) set as decimal separator

Signed-off-by: Stephan Richter <[email protected]>
  • Loading branch information
StephanRichter authored Apr 12, 2024
1 parent 465e84d commit ec5b511
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class LatencyParser {

Matcher m = LATENCY_PATTERN.matcher(inputLine);
if (m.find() && m.groupCount() == 1) {
return millisToDuration(Double.parseDouble(m.group(1)));
return millisToDuration(Double.parseDouble(m.group(1).replace(",", ".")));
}

logger.debug("Did not find a latency value");
Expand Down

0 comments on commit ec5b511

Please sign in to comment.