MeasurementUnit

data class MeasurementUnit(val canonical: String, val dimension: String)

A unit of measure: its canonical name, and the kind of quantity it measures.

dimension is what stops UnitGuard comparing across kinds. pound is a mass and gbp is a currency, so "250 euros in British pounds" and "250 EUR in GBP" look like a unit swap while being the same question written two ways. Units are only comparable when they measure the same thing.

Constructors

Link copied to clipboard
constructor(canonical: String, dimension: String)

Properties

Link copied to clipboard

Name shared by every spelling of this unit.

Link copied to clipboard

The kind of quantity — length, mass, currency, timezone, and so on.