Skip to main content

unit_conversion

Function unit_conversion 

Source
pub fn unit_conversion(
    value: f64,
    from: &str,
    to: &str,
) -> Result<f64, ErrorsJSL>
Expand description

Converts value from unit from to unit to, e.g. unit_conversion(100.0, "km/h", "mph").

Errors for unknown units or when the units belong to different dimensions.