Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: on Google App Script, banks and cities with leading zero code were incorrectly parsed. #14

Merged
merged 1 commit into from
Jul 11, 2019
Merged

Fix: on Google App Script, banks and cities with leading zero code were incorrectly parsed. #14

merged 1 commit into from
Jul 11, 2019

Conversation

pupitetris
Copy link

Some versions of Javascript (Google App Script) still neeed the second
parameter (number base) for parseInt to be explicitly 10. Applied this
everywhere, although this was affecting banks: CLABES with a 0xx code (such as
BANORTE, "072") were being interpreted wrong, because the leading zero means
"this is an octal number" (so, parseInt("072") returns 58, not 72) to parseInt
in default mode on some versions of JS. This made a valid BANORTE clabe to be
interpreted as having a BANREGIO bank tag (funny coincidence). This was
probably affecting city codes with leading zeroes too.

parameter (number base) for parseInt to be explicitly 10. Applied this
everywhere, although this was affecting banks: CLABES with a 0xx code (such as
BANORTE, "072") were being interpreted wrong, because the leading zero means
"this is an octal number" (so, parseInt("072") returns 58, not 72) to parseInt
in default mode on some versions of JS. This made a valid BANORTE clabe to be
interpreted as having a BANREGIO bank tag (funny coincidence). This was
probably affecting city codes with leading zeroes too.
@dpilafian dpilafian merged commit e1fac50 into center-key:master Jul 11, 2019
@pupitetris pupitetris deleted the fix-2digit-banks-parseInt branch July 11, 2019 04:09
@dpilafian
Copy link
Member

Wow, bummer that Google App Script is so behind the times. C'est la vie!

Release v1.3.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants