Skip to content

StrToFloat is locale specific #1

Description

@svip

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions