Skip to content

Commit

Permalink
Add example to README
Browse files Browse the repository at this point in the history
  • Loading branch information
bombsimon committed May 26, 2024
1 parent a6238cb commit 84e9f1b
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,39 @@
```sh
gleam add personnummer
```

```gleam
import personnummer
pub fn main() {
// TODO: An example of the project in use
let assert Ok(pnr) = personnummer.new("19900101-0017")
io.debug(
[
"The person with personal identity number ",
pnr
|> personnummer.format(True),
" is a ",
case
pnr
|> personnummer.is_male()
{
True -> "male"
False -> "female"
},
" of age ",
pnr
|> personnummer.age
|> int.to_string(),
]
|> string.concat,
)
}
```

```sh
"The person with personal identity number 19900101-0017 is a male of age 34"
```

Further documentation can be found at <https://hexdocs.pm/personnummer>.

## Development
Expand Down

0 comments on commit 84e9f1b

Please sign in to comment.