Reference·JavaScript · @sascom/commonjsJavaScript

ParsedQuantity

Interface in @sascom/commonjs.

API catalogue · @sascom/commonjs · Interface

TypeScript#
interface ParsedQuantity

A quantity that parsed

Members#

Member Kind Description
assumedUnit Property The unit taken for a bare number; null when a unit was typed
exact Property Whether the value has at most 3 decimals in the typed unit (inches for "ft-in")
kind Property
ok Property
typedUnit Property The unit typed: a symbol, "ft-in" for feet with inches, "mixed" for other combinations, null for a bare number
unit Property The canonical unit's symbol
value Property In the canonical unit of the kind: mm, degrees, mm², mm³

assumedUnit#

TypeScript#
assumedUnit: string | null

The unit taken for a bare number; null when a unit was typed

exact#

TypeScript#
exact: boolean

Whether the value has at most 3 decimals in the typed unit (inches for "ft-in")

kind#

TypeScript#
kind: QuantityKind

ok#

TypeScript#
ok: true

typedUnit#

TypeScript#
typedUnit: string | null

The unit typed: a symbol, "ft-in" for feet with inches, "mixed" for other combinations, null for a bare number

unit#

TypeScript#
unit: string

The canonical unit's symbol

value#

TypeScript#
value: number

In the canonical unit of the kind: mm, degrees, mm², mm³