Measurements for OpenOffice.org
"Measurements" is an Openoffice.org Calc add-in I wrote
that provides a basic set of spreadsheet functions for
manipulating scientific measurements, tracking units of measure
and significant figures.
It is available here and on the main OpenOffice.org Extensions site.
To install: The add-in comes in a UNO package
named measurements-V.oxt,
where V stands for the version. Download the newest
version. In OpenOffice, go to Tools -> Extension Manager... -> My Extensions ->
Add... -> browse for measurements-V.oxt -> Open. Then restart OpenOffice.org.
(If you are upgrading, remove the old package and restart OpenOffice.org first.)
Here is the UNO package for download.
To use:
- You might like to look at the demo spreadsheet.
- Input a measurement as a string consisting of a floating-point
numerical value (scientific notation preferred), a space, and
a unit expression. The unit expression consists of one or more
unit symbols, each optionally
raised to an integer power with ^, and separated by *,
space (implied multiply), or / (inverts the rest of
the expression). Example: 1.20E3 kg*m^2/s^2. Only a
few units are supported so far; see the list in
Unit.java.
- The number of significant figures is inferred from your entry.
You can indicate that a number is exact by following it with a lowercase x.
- A measurement that does not contain a space is interpreted
as an exact pure number (because the spreadsheet forgets the
number of sig figs entered by the user anyway). To enter an
inexact pure number, enter a formula containing a literal string
with a trailing space: ="1.497 ".
- Use the M* functions (MADD, MSUB, MMUL, MDIV, MNEG,
MPOWINT, MROOTINT, MPOW, MEXP, MLN) to do arithmetic on measurements.
A computed result
shows up as a scientific-notation value to the correct number of
significant figures and units (for your benefit)
followed by a code containing the add-in's representation of the
result (including precision beyond the significant figures).
Example: If mass is in A1 and volume is in A2, put this in A3 to
compute the density: =MDIV(A1;A2).
- The difference between MPOWINT and MPOW is that MPOW lets you
use a pure-number measurement for the exponent but requires the
base to be a pure number, while MPOWINT lets you use a base
with units but requires the exponent to be an integer.
- To have a computed result shown in units other than the
default, pass it and the desired unit expression to MSTRAS.
Example: =MSTRAS("1 m^3";"L"). This affects only the
user-friendly form, not the code.
- If you're picky and want to show the user-friendly form of
a result without the code, use MCLEANSTR. There is also
MCLEANSTRAS.
- If you see ERROR, something went wrong, but you have to
guess what. :) A future version might have better diagnostics.
If you find bugs (which are almost certain to exist),
please report them to me!
Legal
Measurements consists of:
Measurements comes with absolutely no warranty.
Version log
- Version 1 (2007-09-09): It works!
- Version 1.1 (2008-01-07):
Packaging adjusted so it installs properly in OpenOffice.org 2.3.
- Version 1.2 (2009-02-06):
Update build process for OpenOffice.org 3.0 and improve documentation.
- Version 1.3 (2009-09-15):
Adjust packaging and build against Java 1.5 for greater compatibility.
Source repository
Here is the git repository containing the source code.
You can follow the link to browse the repository in gitweb or clone from it using the git tools.