Skip to content

Fails to parse decimal number #142

Description

@lpatiny

It seems that if one of the parameter if a number containing a decimal it fails (only if there is a default value for this parameter) and returns the integer value.

const args = require('args');
args.option('abc', 'This is a test', 0.123);
console.log(process.argv);
const parsed = args.parse(process.argv);
console.log(parsed);
node src/test.js --abc 0.01
// returns { a: 0, abc: 0 }

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions