Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 745 Bytes

File metadata and controls

33 lines (23 loc) · 745 Bytes

humanise

Package Version Hex Docs

gleam add humanise
import gleam/io

import humanise
import humanise/time

pub fn main() {
  humanise.bytes_int(10_000) |> io.println // 10KB

  time.Seconds(0.5) |> time.humanise |> time.to_string |> io.println // 500ms

  time.Hours(1.0) |> time.to_minutes |> echo // 60.0

  time.Months(1.075) |> time.split(time.to_string_full) |> io.println // 1 month, 2.3 days
}

Further documentation can be found at https://hexdocs.pm/humanise.

Development

gleam run   # Run the project
gleam test  # Run the tests