def
func:to
to(val, unit)
Convert a number to the given unit. If the units are not of the same dimension then an exception is raised. The target unit can be a string or a Number. If target unit is a Number, then the scalar value is ignored, but by convention should be 1. Also see as()
function to set a unit without conversion.
Examples:
10kWh.to(1BTU) 10kWh.to("BTU") 75°F.to(1°C) to(75°F, 1°C)