Closed Turee closed 9 years ago
Try 0,1
.
That seems to work. I browsed the type provider code and i thought the parsing is culture invariant. Shouldn't this be the case?
Edit: Atleast TypeProviders.Helpers.fs has CultureInfo.InvariantCulture passed to Double.TryParse. (line 123):
let (|Float|_|) = tryParseWith (fun x -> Double.TryParse(x, NumberStyles.Any, CultureInfo.InvariantCulture))
What do you suggest to fix it? It should be able to parse floats with any decimal separator on machines with any culture.
I do not have a fix yet but i can look into it. Just wanted to make sure this is not a known issue.
The issue was with the SharpYaml failing to parse the 0.1 formatted double value. => Updated SharpYaml that now works. Second issue was with calling a double values ToString() method, which is not culture invariant. Then parser parsed the double with culture invariant setting on resulting invalid results.
I'm creating a pull request.
When i try to define floating point numbers in yaml files type provider reports following error: 'FSharp.Configuration.ConfigTypeProvider+FSharpConfigurationProvider' reported an error: Input string was not in a correct format.
Example yaml file (issue reproduces):
This works fine: