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

StrToFloat is locale specific #1

Open
svip opened this issue Jul 28, 2014 · 0 comments
Open

StrToFloat is locale specific #1

svip opened this issue Jul 28, 2014 · 0 comments

Comments

@svip
Copy link

svip commented Jul 28, 2014

In VSoft.CommandLine.OptionDef.pas, under tkFloat: in TOptionDefinition<T>.Invoke, StrToFloat is called, but StrToFloat is locale specific.

This means that on most European machines, StrToFloat will assume ',' as a decimal separator and not '.'. That might not work well for scripts that use a program using this command line parser.

Now, I cannot find a simple method like Str (which for the reverse case always uses '.' as decimal separator, whereas FloatToStr would always use the locale), so you need to supply a TFormatSettings with DecimalSeparator set to '.' as its second argument.

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

No branches or pull requests

1 participant