Manuals/calci/UNITSOF

From ZCubes Wiki
Jump to navigation Jump to search
UNITSOF(Numeric,Units,Description,MatchAllOnLeft,MatchRightExactly)


  • is any number.
  • can be of any Unit.

Description

  • This function converts the string to a number with units specified.
    • To convert the current value of a variable to a different unit, simply use the <> operator: a<>cm;
  • Any multi unit indication should be in () to avoid confusion with normal code that may mean something else. For 1 meter/second, 1(m/s) or 1<>(m/s) should be used
  • The following list is basic conversion Units:

MassUnits:g,sg,lbm,u,ozm,

DistanceUnits:m,mi,Nmi,in,ft,yd,ang,Pica,

TimeUnits:yr,day,hr,mn,sec,year,s,min,hour,

PressureUnits:Pa,atm,mmHg,

ForceUnits:N,dyn,lbf,

EnergyUnits:J,e,c,cal,eV,HPh,Wh,flb,BTU,

PowerUnits:HP,W,

MagnetismUnits:T,ga,

LiquidUnits:tsp,tbs,oz,cup,pt,qt,gal,l,

Prefixes:Y,Z,E,P,T,G,M,k,h,e,d,c,m,u,n,p,FValue,a,z,y,

Others:rad,deg,F,C,K,dollar,euro,cent,rupee

  • Using Units function we can do with arithmetic Operations also.
  • For Example: UNITS("1km")<+>UNITS("2cm")

Examples

  1. UNITSOF(34,"km") = 34km
  2. UNITSOF(20,"l") = 20l
  3. UNITSOF("98 ga") = 98 ga

See Also

References