Skip to content

[feature request] BigInt support #231

@dhbaird

Description

@dhbaird
// Expect this:
console.log(sprintf("%d", 9999999999999999999999999999999999999999n));
// To print this:
// 9999999999999999999999999999999999999999

// But instead, an error such as the following is generated:
sprintf-js/src/sprintf.js:61
                if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) {
                                                                                ^

TypeError: Cannot convert a BigInt value to a number

Thanks!

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