Skip to content

John-Tuesday/physical-measurement-units

Repository files navigation

physical-measurement-units

Release multiplatform License

Simple Kotlin Multiplatform library which supports different types of units of measure and

Getting started

First, add a dependency to this library.

Gradle (Kotlin DSL)
// build.gradle.kts

dependencies {
    implementation("io.github.john-tuesday:measure:$version")

    // Optional, adds test fixtures
    testImplementation("io.github.john-tuesday:measure-test:$version")
}

Now, use the library!

val quarterGrams: Mass = 5.67.grams
val quarterOz: Mass = 0.2.ounces
val twoQuarters = quarterGrams + quarterOz

Unit types

  • Energy
  • Length
  • Mass
  • Volume

Documentation

Generated api documentation can be found here, and notes on conventions can be found here.

About

Measurement units and conversion between them

Resources

License

Stars

Watchers

Forks

Languages