opsinjs

UnitConversion

An exact conversion between two units of the same kind.

How this is generated

Source: lib/opsinjs.ts. Script: scripts/build-reference.mts. Command: pnpm run generate.

Everything below is copied from the symbol, so a page is improved by improving its doc comment. The API index says why there is a page per symbol and what these pages still do not carry.

UnitConversion

An exact conversion between two units of the same kind.

Applied as to = from * numerator / denominator + offsetNumerator / offsetDenominator. Every field is an integer, and that is deliberate: these are definitions rather than measurements, and a definition stored as a rounded decimal is an approximation wearing a definition's provenance.

basis names the definition each factor comes from. A conversion with no basis does not belong in this system: opsinjs does not own a clinical number, and the ones it does carry are the ones that are true by definition rather than by measurement.

KindDeclared in
interfacelib/opsinjs.ts
export interface UnitConversion {
  from: string
  to: string
  numerator: number
  denominator: number
  offsetNumerator: number
  offsetDenominator: number
  basis: string[]
}

On this page