From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/103160 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Clyde Johnston" Newsgroups: gmane.comp.tex.context Subject: Re: Automatic thousands separation in \unit Date: Thu, 31 Jan 2019 16:00:53 +0200 Message-ID: <000601d4b96d$6236cf40$26a46dc0$@couthies.com> References: <20190131132800.0eb21089@homerow> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7871539196451685860==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="172961"; mail-complaints-to="usenet@blaine.gmane.org" To: "'mailing list for ConTeXt users'" Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 31 15:01:44 2019 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gpCuU-000ijl-EE for gctc-ntg-context-518@m.gmane.org; Thu, 31 Jan 2019 15:01:42 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1CA10DAA57; Thu, 31 Jan 2019 15:01:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I9kzGvfi4TxU; Thu, 31 Jan 2019 15:01:05 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8A8BCDAA54; Thu, 31 Jan 2019 15:01:05 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 22FFCDAA54 for ; Thu, 31 Jan 2019 15:01:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GyaGOlE-WrXH for ; Thu, 31 Jan 2019 15:01:01 +0100 (CET) Original-Received: from mx2.starman.ee (smtp-out4.starman.ee [85.253.0.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 3B8C0DAA4C for ; Thu, 31 Jan 2019 15:01:01 +0100 (CET) X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mx2.starman.ee ([127.0.0.1]) by localhost (mx2.starman.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Anc72gsEZnwf for ; Thu, 31 Jan 2019 16:01:00 +0200 (EET) Original-Received: from mail.ee.clyde.johnston.name (85.253.98.252.cable.starman.ee [85.253.98.252]) by mx2.starman.ee (Postfix) with ESMTP id 1E592A0BF9 for ; Thu, 31 Jan 2019 16:00:59 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at Original-Received: from mail.ee.clyde.johnston.name ([127.0.0.1]) by localhost (mail.couthies.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CAR_RMtOek0c for ; Thu, 31 Jan 2019 16:00:56 +0200 (EET) Original-Received: from thunderer (85.253.98.252.cable.starman.ee [85.253.98.252]) by mail.ee.clyde.johnston.name (Postfix) with ESMTPSA id 770C34634F for ; Thu, 31 Jan 2019 16:00:56 +0200 (EET) In-Reply-To: X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHbXJB/AwQIHCSrrwg+Tc3ZehaDTwJRMq03pamWpzA= Content-Language: en-us X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.20 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:103160 Archived-At: This is a multipart message in MIME format. --===============7871539196451685860== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0007_01D4B97E.25C089A0" Content-Language: en-us This is a multipart message in MIME format. ------=_NextPart_000_0007_01D4B97E.25C089A0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Maybe this should be a language specific parameter. How would you achieve a similar result with the Indian numbering system , for instance? Also, decimal and thousands separators vary from country to country. In France, for example, they use the comma for the decimal separator, and space for the thousand separator. Clyde From: ntg-context [mailto:ntg-context-bounces@ntg.nl] On Behalf Of Otared Kavian Sent: Thursday, January 31, 2019 2:43 PM To: mailing list for ConTeXt users Subject: Re: [NTG-context] Automatic thousands separation in \unit Hi Marco, Can this give what you wish? \define[2]\myunit{\spaceddigits{#1}\unit{#2}} \starttext \myunit{123456789}{volt} \stoptext On 31 Jan 2019, at 13:28, Marco Patzer wrote: Hi! I'm wondering if there's a way to have automatic thousands separation in the \unit command? \spaceddigits does that, but it doesn't work inside \unit. And using both would be quite verbose to write. Example: \starttext %% no thousands separation \unit{123456789 volt} %% manual thousands separation works \unit{123,456,789 volt} %% automatic thousands separation, but not using \unit \let\spaceddigitsseparator, \spaceddigits{123456789}\,V %% fails, no output \unit{\spaceddigits{123456789} volt} \stoptext Marco ____________________________________________________________________________ _______ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ____________________________________________________________________________ _______ ------=_NextPart_000_0007_01D4B97E.25C089A0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Maybe this should be a language specific parameter.  How would = you achieve a similar result with the Indian = numbering system, for instance?

 

Also, decimal and thousands separators vary from country to = country.  In France, for example, they use the comma for the = decimal separator, and space for the thousand = separator.

 

Clyde

 

 

From:= = ntg-context [mailto:ntg-context-bounces@ntg.nl] On Behalf Of = Otared Kavian
Sent: Thursday, January 31, 2019 2:43 = PM
To: mailing list for ConTeXt users
Subject: Re: = [NTG-context] Automatic thousands separation in = \unit

 

Hi = Marco,

 

Can this give what you = wish?

 

\define[2]\myunit{\spacedd= igits{#1}\unit{#2}}

\starttext 

\myunit{123456789}{volt}

\stoptext

 



On 31 = Jan 2019, at 13:28, Marco Patzer <lists@homerow.info> = wrote:

 

Hi!

I'm wondering if there's a way to have = automatic thousands separation in the
\unit command? \spaceddigits = does that, but it doesn't work inside \unit. And
using both would be = quite verbose to write. Example:

\starttext
 %% no = thousands separation
 \unit{123456789 volt}

 %% = manual thousands separation works
 \unit{123,456,789 = volt}

 %% automatic thousands separation, but not using = \unit
 \let\spaceddigitsseparator,
 \spaceddigits{1234567= 89}\,V

 %% fails, no = output
 \unit{\spaceddigits{123456789} = volt}
\stoptext

Marco
______________________________________= _____________________________________________
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://context.aanhet.net
archi= ve  : https://bitbuc= ket.org/phg/context-mirror/commits/
wiki =     : http://contextgarden.net
_______= _________________________________________________________________________= ___

 

------=_NextPart_000_0007_01D4B97E.25C089A0-- --===============7871539196451685860== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============7871539196451685860==--