Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Fix numeric bank code
Browse files Browse the repository at this point in the history
  • Loading branch information
fourcube committed Jul 8, 2016
1 parent 5af66c5 commit aab9ceb
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions countries/lu.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,30 @@ THE SOFTWARE.
*/
package countries

import "strings"
import (
"strconv"
"strings"
"fmt"
)

type LuxembourgFileEntry struct {
Bankcode string
Name string
Bic string
}

// Return a slice of BankEntries because BICs can map to multiple
// Bankcodes
// Returns a single file entry
func LuxembourgRowToEntry(row []string) LuxembourgFileEntry {
bankCode, err := strconv.Atoi(row[1])
bankCodeStr := ""

if err == nil {
bankCodeStr = strings.TrimSpace(fmt.Sprintf("%03d", bankCode))
}

return LuxembourgFileEntry{
Name: strings.TrimSpace(row[0]),
Bankcode: strings.TrimSpace(row[1]),
Bankcode: bankCodeStr,
Bic: strings.TrimSpace(row[2]),
}
}

0 comments on commit aab9ceb

Please sign in to comment.