@qudtlib/core
Version:
Data model for QUDTLib
17 lines (16 loc) • 497 B
JavaScript
export class QuantityValue {
constructor(quantity, unit) {
this.value = quantity;
this.unit = unit;
}
equals(other) {
return (!!other && this.value.equals(other.value) && this.unit.equals(other.unit));
}
toString() {
return this.value.toString() + this.unit.toString();
}
convert(to, quantityKind) {
return new QuantityValue(this.unit.convert(this.value, to, quantityKind), to);
}
}
//# sourceMappingURL=quantityValue.js.map