Skip to content

Commit

Permalink
Merge pull request #25 from organisationsnummer/fix-plus
Browse files Browse the repository at this point in the history
Allow + characters in enskild firma
  • Loading branch information
frozzare authored Feb 20, 2024
2 parents 4a30f3e + f9ee43a commit 81f697f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.12.x, 1.18.x]
go-version: [1.12.x, 1.22.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
7 changes: 6 additions & 1 deletion organisationsnummer.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,13 @@ func (o *Organisationsnummer) Format(separator ...bool) string {
var number = o.number

if o.IsPersonnummer() {
if len(separator) > 0 && separator[0] {
f, _ := o.personnummer.Format(false)
return f
}

f, _ := o.personnummer.Format(true)
number = f[2:]
return f[2:]
}

if len(separator) > 0 && separator[0] {
Expand Down

0 comments on commit 81f697f

Please sign in to comment.