oolong 发表于 2010-1-4 10:10:41

一千怎么办 1*1000+

xiaoxiaoxue 发表于 2010-1-4 10:37:00

能存到我帐户不

ajump 发表于 2010-1-4 10:40:36

原帖由 killunix 于 2009-10-28 11:50 PM 发表 http://pkuxkx.net/forum/images/common/back.gif
不仅仅是为了存钱啊,还有别的用处
难道是为了看mm的三围?

强烈建议增加一个道具,lookin,她的三围是 XXX XX XX

duno 发表于 2010-1-4 17:09:51

原帖由 oolong 于 2010-1-4 10:10 AM 发表 http://pkuxkx.net/forum/images/common/back.gif
一千怎么办 1*1000+
462测试LOG,一千没问题一千文
1*1000 = 1000

这几句就是特殊处理的
str=" "%1" ";...
str=%replace(@str,"+ ","");
str=%replace(@str," *","");

gamesover 发表于 2010-4-26 15:17:04

借钱楼主的思路,我写了个函数,可以转换亿元以下的中文数字到阿拉伯数字
我是这样处理的,万以下的数字很简单,直接处理;万以上的数字分开两部分,a*10000+b
我的思路很简单,程序很直白,高手不要笑话我yct18
亿以上数字也类似思路处理即可

#Function figure()
{
#if !%pos("万",%1)
{
    str=" "%1" "
    str=%replace( @str, "万", "*10000+")
    str=%replace( @str, "千", "*1000+")
    str=%replace( @str, "百", "*100+")
    str=%replace( @str, "十", "*10+")
    str=%replace( @str, "零", "")
    str=%replace( @str, "一", "1")
    str=%replace( @str, "二", "2")
    str=%replace( @str, "三", "3")
    str=%replace( @str, "四", "4")
    str=%replace( @str, "五", "5")
    str=%replace( @str, "六", "6")
    str=%replace( @str, "七", "7")
    str=%replace( @str, "八", "8")
    str=%replace( @str, "九", "9")
    str=%replace( @str, " *", "")
    str=%replace( @str, "+ ", "")
    #return %eval( @str)
}
{
    str1=" "%left(%1,%pos("万",%1)-1)" "
    str1=%replace( @str1, "万", "*10000+")
    str1=%replace( @str1, "千", "*1000+")
    str1=%replace( @str1, "百", "*100+")
    str1=%replace( @str1, "十", "*10+")
    str1=%replace( @str1, "零", "")
    str1=%replace( @str1, "一", "1")
    str1=%replace( @str1, "二", "2")
    str1=%replace( @str1, "三", "3")
    str1=%replace( @str1, "四", "4")
    str1=%replace( @str1, "五", "5")
    str1=%replace( @str1, "六", "6")
    str1=%replace( @str1, "七", "7")
    str1=%replace( @str1, "八", "8")
    str1=%replace( @str1, "九", "9")
    str1=%replace( @str1, " *", "")
    str1=%replace( @str1, "+ ", "")
    str2=" "%right(%1,%pos("万",%1)+1)" "
    str2=%replace( @str2, "万", "*10000+")
    str2=%replace( @str2, "千", "*1000+")
    str2=%replace( @str2, "百", "*100+")
    str2=%replace( @str2, "十", "*10+")
    str2=%replace( @str2, "零", "")
    str2=%replace( @str2, "一", "1")
    str2=%replace( @str2, "二", "2")
    str2=%replace( @str2, "三", "3")
    str2=%replace( @str2, "四", "4")
    str2=%replace( @str2, "五", "5")
    str2=%replace( @str2, "六", "6")
    str2=%replace( @str2, "七", "7")
    str2=%replace( @str2, "八", "8")
    str2=%replace( @str2, "九", "9")
    str2=%replace( @str2, " *", "")
    str2=%replace( @str2, "+ ", "")
    #return %eval( @str1)*10000+%eval(@str2)
}
}
页: 1 [2]
查看完整版本: 我也请教一个函数