ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Robin Kirkham <robin.kirkham@csiro.au>
To: "ntg-context@ntg.nl" <ntg-context@ntg.nl>
Subject: Re: Number formatting in \unit
Date: Mon, 12 Dec 2011 11:14:52 +1100	[thread overview]
Message-ID: <239E210D-A1AE-4A67-B664-21DD3EB001CF@csiro.au> (raw)
In-Reply-To: <mailman.1183.1323603877.4232.ntg-context@ntg.nl>


[-- Attachment #1.1: Type: text/plain, Size: 1549 bytes --]

On 11 December 2011, Xenia <yoraxe@googlemail.com> wrote:

> Am 11.12.2011 11:25, schrieb Robin.Kirkham@csiro.au:
>> All,
>> 
>> I have put together some suggestions to extend the number formatting
>> capability in \unit, particularly for scientific and engineering purposes,
>> including basic support for tolerances and uncertainties.
>> 
>> It is a bit long, so source is attached and a PDF is at
>> 
>> http://dl.dropbox.com/u/36891398/units6.pdf
>> 
>> Of course, this is just my opinion, so I welcome any feedback from the list.
> 
> I like your suggestions. Especially the current handling of `e-23` etc.
> is not intuitive but rather confusing and does not meet the standard.
> 
> I do not know if there is already a solution for automatically
> shortening the number of digits in the output, but that would be nice, too.
> 
> Xenia

Yes, I thought about that, of course, but did not put it forward because to do it properly the correct numeric rounding/significant figures rules should be applied, and that I guess means the Lua code needs to interpret the number, rather than just treat it as a sequence of digits.

However if the Lua code did interpret the number into an internal format it would enable other things like normalisation to scientific or engineering form, etc. However the internal format would have to support arbitrarily long numbers and exponents ... Lua's built-in internal number format (a double precision float, I think) would not do, so there would be a bit of coding involved.

Robin


[-- Attachment #1.2: Type: text/html, Size: 3177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

       reply	other threads:[~2011-12-12  0:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1183.1323603877.4232.ntg-context@ntg.nl>
2011-12-12  0:14 ` Robin Kirkham [this message]
     [not found] <746538930812A54DA07A768D52329470020EE17448@exvic-mbx01.nexus.csiro.au>
2011-12-11 10:25 ` Robin.Kirkham
2011-12-11 11:24   ` Xenia
2011-12-11 15:42   ` Marco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=239E210D-A1AE-4A67-B664-21DD3EB001CF@csiro.au \
    --to=robin.kirkham@csiro.au \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).