FSharp.Data icon indicating copy to clipboard operation
FSharp.Data copied to clipboard

CsvProvider fails to parse float formatted as -7e-04

Open pkese opened this issue 5 years ago • 1 comments

Apparently there's a problem with parsing .csv file when a float is formatted as -7e-04.

Following is the code snippet.

CsvProvider<"https://github.com/TheEconomist/big-mac-data/raw/master/output-data/big-mac-raw-index.csv">
    .GetSample()
    .Rows
|> Seq.iter (fun row -> printfn "%s @ %d -> %f" row.Iso_a3 row.Date.Year row.Dollar_price)

Source .csv is
https://github.com/TheEconomist/big-mac-data/raw/master/output-data/big-mac-raw-index.csv
and the offending row is

2017-01-01,CRI,CRC,Costa Rica,2250,554.33,4.05895405264012,-0.19784,-7e-04,0.08866,0.24615,0.43443

NOTICE:
I've tried to download the whole .csv to disk and curiously it works when data is read from local file.
It only fails when accessed through http.

pkese avatar Feb 04 '20 14:02 pkese

Could this be a text-encoding issue?

deviousasti avatar Feb 12 '20 17:02 deviousasti