SI-value (proc)
public {SI-value s:any}:double
Package: CURL.LANGUAGE.UNITS

Returns the SI value of a quantity.

Description

The SI value of a quantity is a number representing the amount of that quantity in the scale of the SI unit appropriate.

Fundamental QuantitySI Unit
Distancemeter
Masskilogram
Timesecond
Energy Intensitycandela


Compound units in the SI system are designed so that there are no scale factors.

Curl extends the SI system with a unit for angular measure. Numbers that carry no units are simply returned. Note that percents are directly convertible to fractions, so 3% is equal to 0.03 for the purposes of the SI value.

Fundamental QuantityUnit
Angleradian
Number(no unit)


Throws an exception if scalar? s is not true.

To turn a unitless SI value back into a quantity value, you can simply multiply it by the unit value for that quantity. For instance, to convert the value 34.2 into 34.2meters you can simply multiply it by 1meter. You can use unit-value-for-type to produce the unit value for any given quantity type. Note that

{SI-value x}

produces the same value as

x / {unit-value-for-type {type-of x}}
s: Must be scalar?.