Skip to content

Commit

Permalink
🚑 corporate tax id maybe start with zero
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsarin authored and dtinth committed Sep 4, 2017
1 parent cb6adec commit 742cd34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function sanitizeTarget (id) {
}

function formatTarget (id) {
return ('0000000000000' + sanitizeTarget(id).replace(/^0/, '66')).slice(-13)
return id.length >= 13 ? sanitizeTarget(id) : ('0000000000000' + sanitizeTarget(id).replace(/^0/, '66')).slice(-13)
}

function formatAmount (amount) {
Expand Down

0 comments on commit 742cd34

Please sign in to comment.