[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH] getting calc-units working in table formulas
From: |
Eric Abrahamsen |
Subject: |
Re: [O] [PATCH] getting calc-units working in table formulas |
Date: |
Sun, 21 Dec 2014 12:22:54 +0800 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) |
Nicolas Goaziou <address@hidden> writes:
> Hello,
>
> Eric Abrahamsen <address@hidden> writes:
>
>> Here's the doc patch, hope all is in order.
>
> Thanks. Some comments follow.
>
>> +Calc also comes with support for unit calculations, via the
>> @code{calc-units}
>> +package. For a complete list of recognized units, call
>> address@hidden Units can be specified with or without a space
>> +between the number and the unit name, eg @samp{2 ft} is the same as
>
> "eg" -> "e.g.,"
>
>> address@hidden Rates are handled automatically: multiplying @samp{3 m/s} by
>> two
>> +will give @samp{6 m / s}. By default, @code{calc-units} only defines one
>> +units-related function for use in tables, @code{usimplify}, which can take
>> an
>> +expression such as @samp{42 km / 2.5 h} and return @samp{16.8 km / hr}.
>> +Another useful function to define might be @code{math-convert-units},
>> eg:
>
> Ditto.
>
>> address@hidden
>> +(defmath uconv (expr target-units &optional pure)
>> + (math-convert-units expr target-units pure))
>> address@hidden example
>
> I think you should use @lisp instead of @example here.
>
>> +Which would allow you to use @samp{uconv($1, ft)} to, for example, convert a
>> +distance specified in the cell @samp{$1} into feet. The optional
>> 'pure
>
> @code{pure} instead of 'pure
Thanks for the notes -- here's another version.
Eric
0001-Mention-calc-units-in-the-spreadsheet-documentation.patch
Description: Text Data