[−]Function lumol::units::from
pub fn from(value: f64, unit: &str) -> Result<f64, ParseError>
Convert the numeric value val
from the unit unit
to the internal unit.
use lumol_core::units; let internal = units::from(10.0, "A").unwrap(); assert!(internal == 10.0);