Skip to content

Problem validating the checksum #2

Description

@robg336699

In this line

number[0].chr.to_i == (10 - ((odd * 3) + even) % 10)

the result on the right side can be 10 which is != 0. Shouldn't it be

number[0].chr.to_i == (10 - ((odd * 3) + even) % 10) % 10

then?!

Thanks for the code anyway.

Cheers,

Robert

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