# How to get the head number (only a digital) in ConTeXt MKIV?

In my country, we usually don't use number 1, 2 ... as the head number (the section number, the chapter number and so on) but our own characters, for instance, the 一 stands for number 1, the 二 stands for number 2, the 十 stands for 10.

Now, all my teachers, maybe you have known what I mean, I hope that I can get the head number, for example, the section number, so, I can define a macro called \def\mysectionnumbers#1{...} and pass it to the option numbercommand in the \setuphead[section][...,numbercommand={\mysectionnumber},...] so that I can change the section number into the 一 二 above.

But, the #1 in the numbercommand = \...#1 is not only a digital, so I can't use the \ifnum or \ifcase. It seems like that it is the ...\getheadnumber.... How can I get the head number and change it?

By the way, what's the replacement text of \getheadnumber?

-
Usually you can create your own number conversion with \defineconversion[foo][A,B,C] and then set \setupheads[conversion=foo], but for some reason this fails for CJK ideographs. – Marco Apr 11 '13 at 12:33
@Marco Thanks very much. It can really work exactly! But I think the users should first define some typescripts and \setscript[hanzi]. – Timothy Li Apr 11 '13 at 12:46
@Marco The \defineconversion and option conversion in \setupheads don't appear in the ConTeXt manual, where have you learnt this commands? Why I can't find this in contextgarden.net? – Timothy Li Apr 11 '13 at 12:54
It probably appeared on the mailing list at some point, but it's on the ConTeXt wiki - defineconversion, too. Actually, I just checked the source and the chinese conversion is already defined, check: \dorecurse{42}{\convertnumber{cn}{\recurselevel}}. But I still don't know why it fails within the head setup. – Marco Apr 11 '13 at 13:17
@Marco please wait for a moment, let me have a try again. – Timothy Li Apr 11 '13 at 13:39

If you use a font which contains the necessary characters all you need is \setupheads[conversion=cn]. Here a full example:

\setupbodyfont [heiti]
\setscript     [hanzi]