from_nrv_unit
- nrv.utils.from_nrv_unit(value, unit)[source]
Convert a quantity
valuefrom the default nrv units tounit.- Parameters:
- Returns:
rounded value or values, with the same type and shape than
value.- Return type:
Example
Here are three ways of converting 4530um (default unit) into 4.53mm:
>>> import nrv >>> val_default = 4530 # um >>> val_default / nrv.mm 4.53 >>> nrv.from_nrv_unit(val_default, nrv.mm) 4.53 >>> nrv.from_nrv_unit(val_default, "mm") 4.53