EnglishFrenchSpanish

OnWorks favicon

units-filter - Online in the Cloud

Run units-filter in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command units-filter that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


units-filter - is a parser for physical and chemical quantities

SYNOPSIS


units-filter -s -o -l

DESCRIPTION


units-filter is a basic standalone parser written in C language, flex and bison. It inputs
strings like "1.5e3 nN.m.s^-1" (it could be the time growth ratio of a torque) and outputs
the value in standard SI unit, followed by the physical dimension of this value.

OPTIONS


-s
Like Significant.

Takes in account the number of significant digits. For example 1.0 m contains 2
significant digits, while 0.00100 contains 3 significant digits. It is possible to
enforce the number of significant digits by using a special syntax : if units-filter
parses the input "1.0m#6", it interprets it as a value with exactly 6 significant
digits, like "1.00000 m". The number following the # sign is the forced number of
significant digits. The number of significant digits appears just before the last zero
in the output of the command (this zero is a placeholder for future extensions).

-o
Like Output.

Outputs a correct representation of the physical quantity with its physical unit in
the International System notation. There may be some simplification with usual units.
For example, a newton will be represented by the unit N in place of m.kg.s^-2. The
value is expressed as a floating number with one digit before the decimal point, and
as many digits in the mantissa as necessary to fit the desired number of significant
digits (see an example below). It is possible to enforce the output unit : just add a
colon and the desired unit at the end of the input. If this unit is homogeneous with
the former one, it will be used to format the output.

-l
Like LaTeX.

Outputs a correct representation of the physical quantity with its physical unit in
the International System notation, in LaTeX language.

EXAMPLES


Establish the SI value and unit exponent of a quantity in the mksa system:

~$ echo 1.5e3 nN.m.s^-1 | units-filter

1.5e-6 2 1 -3 0 0 0 0

which means : 1.5e-6 (SI unit) m^2.kg.s^-3

Compare different physical quantities:

~$ e1=$(echo "1.2e-3 V" | units-filter)

~$ e2=$(echo "1200e3 nWb/s"| units-filter)

~$ if [ "$e1" = "$e2" ]; then echo ok; else echo ko; fi

ok

... which emphasizes that webers by unit time are the same as volts.

Playing with the number of significant digits:

~$ echo "0.00100m" | src/units-filter -s

0.001 1 0 0 0 0 0 0 3 0

~$ echo "0.00100m #2" | src/units-filter -s

0.001 1 0 0 0 0 0 0 2 0

Giving a value for the relative precision:

~$ echo "1kV~2" | units-filter -o

1e+03 V +-2%

Turning on the LaTeX output:

~$ echo "1kohm+-2%" | units-filter -l

1\times 10^{+03}\, \Omega \pm 2\,\%

Turning on the output of a canonical physical notation:

~$ echo "1.0 m.kg.s^-2 #7" | units-filter -o

1.000000e+00N

Choosing a non-standard unit for the output:

~$ echo 1800C:A.h| units-filter -o

5.000e-01 A.h

KNOWN BUGS


Few units out of the mksa system are successfully parsed.

Use units-filter online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Avogadro
    Avogadro
    Avogadro is an advanced molecular
    editor designed for cross-platform use
    in computational chemistry, molecular
    modeling, bioinformatics, materials
    science and ...
    Download Avogadro
  • 2
    XMLTV
    XMLTV
    XMLTV is a set of programs to process
    TV (tvguide) listings and help manage
    your TV viewing, storing listings in an
    XML-based format. There are utilities to
    do...
    Download XMLTV
  • 3
    strikr
    strikr
    Strikr Free Software project. Artifacts
    released under a 'intent based'
    dual license: AGPLv3 (community) and
    CC-BY-NC-ND 4.0 international
    (commercial)...
    Download strikr
  • 5
    GIFLIB
    GIFLIB
    giflib is a library for reading and
    writing gif images. It is API and ABI
    compatible with libungif which was in
    wide use while the LZW compression
    algorithm was...
    Download GIFLIB
  • 6
    Alt-F
    Alt-F
    Alt-F provides a free and open source
    alternative firmware for the DLINK
    DNS-320/320L/321/323/325/327L and
    DNR-322L. Alt-F has Samba and NFS;
    supports ext2/3/4...
    Download Alt-F
  • More »

Linux commands

  • 1
    4s-queryJ
    4s-queryJ
    4s-query � Run SPARQL queries on a
    4store storage backend ...
    Run 4s-queryJ
  • 2
    4ti2-circuits
    4ti2-circuits
    4ti2 - software package for algebraic,
    geometric and combinatorial problems on
    linear spaces ...
    Run 4ti2-circuits
  • 3
    cpufreq-set
    cpufreq-set
    cpufreq-set - A small tool which allows
    to modify cpufreq settings. SYNTAX:
    cpufreq-set [options] DESCRIPTION:
    cpufreq-set allows you to modify cpufreq
    setting...
    Run cpufreq-set
  • 4
    cpufreqd-get
    cpufreqd-get
    cpufreqd-get - Issues "get" commands to
    cpufreqd. SYNTAX: cpufreqd-get [-l]
    PARAMETERS: -l list applied Profiles for
    all cpus. DESCRIPTION: cpufreqd-get
    issues...
    Run cpufreqd-get
  • 5
    gammu
    gammu
    gammu - Does some neat things with your
    cellular phone or modem. ...
    Run gammu
  • 6
    ganglia2pcp
    ganglia2pcp
    ganglia2pcp - import ganglia data and
    create a PCP archive ...
    Run ganglia2pcp
  • More »

Ad