Forums: 公開討議/質問 (Thread #46128)

\kansuji 0 の扱い (2022-07-06 11:03 by h_okumura #90439)

\kansuji 10 → 一〇
\kansuji 0 → 空文字列
であることに気づきました。後者は〇であるべき?

Reply to #90439×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: \kansuji 0 の扱い (2022-07-06 11:40 by kmaeda #90440)

ltj-compat.lua の以下の部分だと思いますが
{{{
local function to_kansuji(num)
if not num then num=0; return
elseif num<0 then
num = -num; tex.write '-'
end
local s = ""
while num~=0 do
s = utfchar(
ltjs.get_stack_table(luatexja.stack_table_index.KSJ + num%10,
'', tex.getcount 'ltj@@stack')) .. s
num=math.floor(num/10)
end
tex.write(s)
end
}}}

while num~=0 do ... end を repeat ... until num==0 にするとよさそうです.
Reply to #90439

Reply to #90440×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: \kansuji 0 の扱い (2022-07-06 12:41 by h7k #90441)

メッセージ #90440 への返信
> while num~=0 do ... end を repeat ... until num==0 にするとよさそうです.

どうもありがとうございます.commit 3c0019d で取り込みました.
Reply to #90440

Reply to #90441×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login