Manuals/calci/UNITS

From ZCubes Wiki
Jump to navigation Jump to search
UNITS(String)


  • is any Unit name with Value.

Description

  • This function converts the string to a number with units specified.
  • If a variable needs to be specified in specific units, simply use the <> operator. Such as: a<>(m/sec).
  • 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. UNITS("5km") = 5km
  2. UNITS("2m")<+>UNITS("8m") = 10m
  3. UNITS("6kg")<+>UNITS("5kg") = 11kg

See Also

References