Quantity.toString

Returns a string representation of the quantity, consisting of the value and a unit symbol or name.

struct Quantity(Unit, ValueType = double)
string
toString
if (
isUnit!Unit
)

Examples

auto l = 6 * metre / second;
assert(l.toString() == "6 metre second^(-1)");
assert(l.toString(UnitString.symbol) == "6 m s^(-1)");

Meta