Skip to content

string.padded-zeros keeps a leading minus in front of the zeros but not a leading plus: "+42" becomes "00+42" #9038

Description

@morphqdd

string.padded-zeros keeps a leading minus sign in front of the zeros, but not a leading plus sign:

"-42".padded-zeros 5   -> "-0042"
"+42".padded-zeros 5   -> "00+42"

"00+42" is not a number any more, "00+42".as-number fails. "+42".as-number and "%d".scanf "+42" both accept the plus sign, so a text with it is a valid number in the rest of the library.

What should happen: a leading + is kept in front of the zeros the same way - is, giving "+0042".

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions