Quantity v0.3.0 Quantity.Sigils View Source
Sigils related to Quantity and Decimal
Link to this section Summary
Link to this section Functions
Construct a Quantity
iex> ~Q[12.340 kwh] Quantity.new(~d[12.340], "kwh")
iex> ~Q[15 $/banana] Quantity.new(~d[15], {:div, "$", "banana"})
iex> ~Q[12.34 m*m] Quantity.new(~d[12.34], {:mult, "m", "m"})
Construct a Decimal
iex> ~d[12.340] Decimal.new("12.340")