Converting Float/JSON

I am converting the float value of a dataset doing this:

JSONObject.AddPair(fdn, TJSONNumber.Create(aDataSet.Fields[i].AsFloat));

To retrieve the value back from JSON to the dataset I do

field.AsFloat := StrToFloat(JSONValue.Value);

The problem here is, that the format settings are not used. So TJSONNumber.Create(aDataSet.Fields[i].AsFloat)) creates a string "123.88" with the dot as decimal separator. Whereas the StrToFloat(JSONValue.Value,fs) uses (in Austria) the comma as decimal seperator, so the resulting value is 12388.

I work around this by excplicitly setting FormatSettings when converting back. But I wonder if I am missing something.

I think you can just cast it as field.AsFloat := Double(JSONValue.Value);