oetiker/rrdtool-1.x — pull request #365 by octo (2013-01-18 15:30:05+00:00)
Title: Use the "C" locale when parsing data returned by the caching daemon.

The C function `strtod()` takes the locale into account and assumes a comma as the decimal separator with some of them, e.g. German. This patch explicitly set's `LC_NUMERIC` to the portable "C" locale to avoid this behavior. Unfortunately not very pretty, but I'm not aware of a more elegant solution.

Best regards,
—octo

With a German locale:

```sh
/usr/bin/rrdtool fetch $FILE -s "-10min " AVERAGE -e "now" --daemon /var/run/rrdcached.sock
value

1358517120: nan
1358517180: 4,0000000000e+00
1358517240: 4,0000000000e+00
1358517300: 4,0000000000e+00
1358517360: 4,0000000000e+00
1358517420: 4,0000000000e+00
1358517480: 4,0000000000e+00
1358517540: 4,0000000000e+00
1358517600: 4,0000000000e+00
1358517660: nan
1358517720: nan
```

With "C" locale:

```sh
LC_ALL="C" /usr/bin/rrdtool fetch --daemon /var/run/rrdcached.sock $FILE -s "-10min " AVERAGE -e "now"
value

1358519460: 4.2230000000e+01
1358519520: 4.2230000000e+01
1358519580: 4.2230000000e+01
1358519640: 4.2230000000e+01
1358519700: 4.2230000000e+01
1358519760: 4.2230000000e+01
1358519820: 4.2230000000e+01
1358519880: 4.2230000000e+01
1358519940: 4.2230000000e+01
1358520000: nan
1358520060: nan
```