把整数转换成英文

2017-05-07 10:50:38 +08:00
 doctorlai

在线工具 https://helloacm.com/tools/convert-arabic-numerals-to-english-words/

源代码: https://helloacm.com/c-coding-exercise-convert-integer-to-english-words/

2519 次点击
所在节点    分享创造
10 条回复
wujunze
2017-05-07 15:02:48 +08:00
不错 感谢分享
sunjourney
2017-05-07 15:11:00 +08:00
感谢分享!
taurenshaman
2017-05-08 10:53:47 +08:00
感谢分享!用 C#改了一下,适配 long (– 9,223,372,036,854,775,808 到 9,223,372,036,854,775,807 )和 ulong ( 0 到 18,446,744,073,709,551,615 ):
https://github.com/taurenshaman/nodes/tree/master/Azure.Functions/nodes-math/Arabic-Numerals-To-English-Words
taurenshaman
2017-05-08 10:55:03 +08:00
吐槽一下 short scale 和 long scale: https://en.wikipedia.org/wiki/Names_of_large_numbers
QAPTEAWH
2017-05-08 15:31:08 +08:00
话说老外经常有神奇的念数字方法,比方说 1200 说成 twelve hundreds...
doctorlai
2017-05-08 16:28:52 +08:00
@QAPTEAWH 是的。 或者 2020 练成 twenty twenty. 我感觉在说电话号码的时候这种读法多一些。
@taurenshaman 牛, 是的, 我看了 wiki 后才发现现在欧洲除了英国外 其它地方 million 是 9 个 0 不是 6 个 0
doctorlai
2017-05-08 16:30:31 +08:00
@taurenshaman 另:给你 github 上提了个 PR
taurenshaman
2017-05-08 17:54:53 +08:00
@doctorlai thank you~~
唉,第一个 PR 啊。。。。。
doctorlai
2017-05-08 18:09:41 +08:00
@taurenshaman 哈哈,是我的第二个。
jedihy
2017-05-09 05:27:54 +08:00
刷题刷的不错啊

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/359655

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX