convert
- nrv.utils.convert(value, unitin, unitout)[source]
Convert a quantity
valuefromunitintounitout.- Parameters:
- Returns:
rounded value or values, with the same type and shape than
value.)- Return type:
Example
Here are two ways of converting 0.2 S/m^{2} into S/cm^{2}:
>>> import nrv >>> val_S_m = 0.2 # S/m**2 >>> nrv.convert(val_S_m, nrv.S/nrv.m**2, nrv.S/nrv.cm**2) 2e-05 >>> nrv.convert(val_S_m, "S/m**2", "S/cm**2") 2e-05