ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \unit and french
@ 2012-10-09 19:04 Romain Diss
  2012-10-09 20:01 ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Romain Diss @ 2012-10-09 19:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 733 bytes --]

Hi all,

As you know, the french number format is almost opposite to the english one: 
period and comma have opposite roles.

My question concerns the way to render properly numbers in french with the 
\unit command. I already tried different combinations of 
\setupunit[method=,order=] but I can’t find the right way. I tried even to 
type french or english format as input for \unit but none output is right 
(actually I'd prefer to type french format as \unit input).
Also, when there are "three digits" separators on both sides of the decimal 
point, some method outputs are not consistent.

I attached a not so minimal exemple.

Thanks for any idea to solve this.


-- 
Romain Diss
<romain.diss@yahoo.fr>

[-- Attachment #2: test-unit-02.tex --]
[-- Type: text/x-tex, Size: 3004 bytes --]

\starttext

\startbuffer
\starttabulate[|l|l|l|]
\HL
\NC  \NC \tex{unit} input: french format \NC \NR
\HL
\NC method 0 \NC \setupunits[method=0]\unit{12.345,567 kilogram} --- \unit{12.345,567.89 kilogram} --- \unit{345,567.89 kilogram} \NC \NR
\NC method 1 \NC \setupunits[method=1]\unit{12.345,567 kilogram} --- \unit{12.345,567.89 kilogram} --- \unit{345,567.89 kilogram} \NC \NR
\NC method 2 \NC \setupunits[method=2]\unit{12.345,567 kilogram} --- \unit{12.345,567.89 kilogram} --- \unit{345,567.89 kilogram} \NC \NR
\NC method 3 \NC \setupunits[method=3]\unit{12.345,567 kilogram} --- \unit{12.345,567.89 kilogram} --- \unit{345,567.89 kilogram} \NC \NR
\NC method 4 \NC \setupunits[method=4]\unit{12.345,567 kilogram} --- \unit{12.345,567.89 kilogram} --- \unit{345,567.89 kilogram} \NC \NR
\NC method 5 \NC \setupunits[method=5]\unit{12.345,567 kilogram} --- \unit{12.345,567.89 kilogram} --- \unit{345,567.89 kilogram} \NC \NR
\NC method 6 \NC \setupunits[method=6]\unit{12.345,567 kilogram} --- \unit{12.345,567.89 kilogram} --- \unit{345,567.89 kilogram} \NC \NR
\HL
\stoptabulate

\starttabulate[|l|l|l|]
\HL
\NC  \NC \tex{unit} input: english format \NC \NR
\HL
\NC method 0 \NC \setupunits[method=0]\unit{12,345.567 kilogram} --- \unit{12,345.567,89 kilogram} --- \unit{345.567,89 kilogram} \NC \NR
\NC method 1 \NC \setupunits[method=1]\unit{12,345.567 kilogram} --- \unit{12,345.567,89 kilogram} --- \unit{345.567,89 kilogram} \NC \NR
\NC method 2 \NC \setupunits[method=2]\unit{12,345.567 kilogram} --- \unit{12,345.567,89 kilogram} --- \unit{345.567,89 kilogram} \NC \NR
\NC method 3 \NC \setupunits[method=3]\unit{12,345.567 kilogram} --- \unit{12,345.567,89 kilogram} --- \unit{345.567,89 kilogram} \NC \NR
\NC method 4 \NC \setupunits[method=4]\unit{12,345.567 kilogram} --- \unit{12,345.567,89 kilogram} --- \unit{345.567,89 kilogram} \NC \NR
\NC method 5 \NC \setupunits[method=5]\unit{12,345.567 kilogram} --- \unit{12,345.567,89 kilogram} --- \unit{345.567,89 kilogram} \NC \NR
\NC method 6 \NC \setupunits[method=6]\unit{12,345.567 kilogram} --- \unit{12,345.567,89 kilogram} --- \unit{345.567,89 kilogram} \NC \NR
\HL
\stoptabulate
\stopbuffer

\language[en]
What is expected in french:

\language[fr]
\m{12\,345,567}~kg --- \m{12\,345,567\,89}~kg --- \m{345,567\,89}~kg

\language[en]
What would be expected in english:

\language[fr]
\m{12,345.567}~kg --- \m{12,345.567,89}~kg --- \m{345.567,89}~kg

\stoptabulate

\startsection[title=French language]

  \language[fr]

  \startsubsection[title=Normal order]
  
  \setupunit[order=normal]
  \getbuffer

  \stopsubsection

  \startsubsection[title=Reverse order]
  
  \setupunit[order=reverse]
  \getbuffer

  \stopsubsection

\stopsection

\startsection[title=English language]

  \language[en]

  \startsubsection[title=Normal order]
  
  \setupunit[order=normal]
  \getbuffer

  \stopsubsection

  \startsubsection[title=Reverse order]
  
  \setupunit[order=reverse]
  \getbuffer

  \stopsubsection

\stopsection


\stoptext

[-- Attachment #3: 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-10-10 20:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-09 19:04 \unit and french Romain Diss
2012-10-09 20:01 ` Wolfgang Schuster
2012-10-09 20:06   ` Wolfgang Schuster
2012-10-09 20:11   ` Marco Patzer
2012-10-09 20:29     ` Wolfgang Schuster
2012-10-09 20:40       ` Marco Patzer
2012-10-09 21:08       ` Romain Diss
2012-10-10 15:41         ` Sietse Brouwer
2012-10-10 19:25           ` Romain Diss
2012-10-10 19:51             ` Wolfgang Schuster
2012-10-10 20:59               ` Sietse Brouwer

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).