This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / I'm working on a project that need support Arabic. How to convert English number to Arabic number in Java?
-guangzhouren(丑小鸭);
2008-1-15
(#4190884@0)
-
那位知道能否指点一下?Thanks a lot.
-guangzhouren(丑小鸭);
2008-1-15
(#4190895@0)
-
看不太明白,小学一年级老师教我们说1,2,3,。。。就叫阿拉伯数字,不知是不是你说的Arabic number,english number 又是指什么 one, two,。。。?别笑话,的确不明
-gdct(喝一碗倒一碗);
2008-1-16
(#4191897@0)
-
Sorry to make you confusion. Actually, Arabic number is not 1,2,3..., that's English numbers. In Arabic, ٨=8, ٩=9, ٢=2, ٣=3, ٠=0, ١=1, ٦=6, ٧=7, ٤=4, ٥=5...I did google for the conversion, just can't get it. The close one I found is:http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=34&t=008375
I test it, it doesn't work. Does anybody has any ideas?
-guangzhouren(丑小鸭);
2008-1-16
{218}
(#4192365@0)
-
I’m not Java guy. But In my sense.If you only need convert number, check out Number Format. If you need show Arabic characters, check out Encoding.
-deep_blue(BLUE);
2008-1-16
{113}
(#4192281@0)
-
Thanks for your reply. Yes, I set the number format by locale. I don't understand about encoding? Could you explain it in details?
-guangzhouren(丑小鸭);
2008-1-16
(#4192380@0)
-
It looks like you need encoding. Look athttp://en.wikipedia.org/wiki/Character_encoding
-deep_blue(BLUE);
2008-1-16
{47}
(#4192423@0)
-
Actually you need Decoding.
-deep_blue(BLUE);
2008-1-16
(#4192432@0)
-
先把问题表述清楚,你是要convert number 还是convert character。比如1->一, 2->二,12->一二这是convert character。12->十二是convert number.
-niu1986(只吃草的牛);
2008-1-16
(#4192391@0)
-
convert charater.
-guangzhouren(丑小鸭);
2008-1-16
(#4192595@0)
-
第一, 我还是第一次知道1,2,3,。。。叫english number,长见识了。
的表达方式, 也可以找个中文转换的参考一下,好像中文就比较复杂了第二,你说的转换有点搞明白了,如果是一一对应的,简单的做个查表就好了,也就是说没有中文那么复杂,一亿零四十,。。。,一个数字只对应一个单词(或几个单词),
如果也象中文似的,还是查表法,只不过规则复杂一点。总之,先得知道你那个Arabic number的文字表达方式,(见过那种文字,和我一年级的图画作业差不多,看不懂)
-gdct(喝一碗倒一碗);
2008-1-16
{309}
(#4192755@0)