Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent handling of numeric decimal separators using invariant culture #159

Closed
stmax82 opened this issue Nov 30, 2020 · 0 comments · Fixed by #160 or #192
Closed

Consistent handling of numeric decimal separators using invariant culture #159

stmax82 opened this issue Nov 30, 2020 · 0 comments · Fixed by #160 or #192

Comments

@stmax82
Copy link
Contributor

stmax82 commented Nov 30, 2020

Description

Numeric decimal separators currently depend on the system culture.
This breaks scripts on systems where the decimal separator isn't ".".

Repro steps

Run the following program on a system that has "," instead of ". " as decimal separator:

open Argu

type CliArguments =
    | Test_Float of float
    interface IArgParserTemplate with
        member s.Usage = ""

[<EntryPoint>]
let main argv =
    let args = ArgumentParser.Create<CliArguments>().Parse argv
    let x = args.GetResult(Test_Float)
    printfn "Test float: %f" x
    0

... with the following command:

dotnet run -- --test-float 1.2

Expected behavior

The expected behavior is that it should print the float.

Actual behavior

The actual behavior is that it fails with the following error:

ERROR: parameter '--test-float' must be followed by <double>, but was '1.2'.

Related information

Argu v6.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant