Skip to content

bombsimon/gleam_personnummer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

personnummer

Package Version Hex Docs

gleam add personnummer
import personnummer

pub fn main() {
  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,
  )
}
"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

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell

About

🔢 Validate Swedish personal identity numbers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages