贴一个把大写转成数字的小程序
triiger(%x)两黄金#var list_gold {十|百|千|万}
#var gold %1
#var gold_1 0
#var gold_2 0
#var gold_num 0
#if (%pos( "十", @gold)=1) {#var gold_num 10} {
#forall @list_gold {
#math gold_1 {@gold_1+1}
gold_2=%pos( %i, @gold)
#if (@gold_2<>0) {
#math gold_2 {@gold_2-2}
gold_2=%copy( @gold, @gold_2, 2)
#math gold_2 {(%pos( @gold_2, "一二三四五六七八九")+1)/2}
gold_3=1
#loop @gold_1 {#math gold_3 {@gold_3*10}}
#math gold_num {@gold_num+@gold_2*@gold_3}
}
}
}
#if (%pos( "零十", @gold)<>0) {#math gold_num {@gold_num+10}}
gold_2=%rightback( @gold, 2)
#math gold_2 {(%pos( @gold_2, "一二三四五六七八九")+1)/2}
#math gold_num @gold_num+@gold_2
#say 苍天啊,大地阿,我怎么只有@gold_num 黄金啊,让我怎么活啊
只能转化一万一下的大写数值
有兴趣的同学修改修改,扩大扩大,精简精简~~~ http://pkuxkx.net/forum/thread-6462-1-1.html
这里有个更巧妙的 http://pkuxkx.net/forum/viewthread.php?tid=1173&extra=page%3D&page=1
这是mush和cmud的
页:
[1]