This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 请教专家,哪里可以找到 javascript that can convert dollar amount to word equivalent used for cheques. 多谢.for example, input is 123.55 output will be something like
*****One hundred twenty three******************************* 55/100
-jsfli06(书法爱好者);
2006-8-16
{131}
(#3146179@0)
-
I have an EXCEL VBA program doing the conversion. PM me if you want.
-sunday8(sunday8);
2006-8-16
(#3146273@0)
-
javascript is much straightforward for my work. thanks anyway.
-jsfli06(书法爱好者);
2006-8-16
(#3146322@0)
-
把VBA翻译成JAVA应该可以省你很多时间
-iwantcar(恶疾,时日无多,戒网);
2006-8-16
(#3146693@0)
-
同学,1、是Javascript不是Java; 2、VBA跟Javascript 处理字符的函数几乎毫无相似之处,两者之间几乎没对应的函数。翻译起来没你说得那么容易。
-canadiantire(轮胎-cui bono?);
2006-8-16
(#3146809@0)
-
关键是算法.
-iwantcar(恶疾,时日无多,戒网);
2006-8-16
(#3146961@0)
-
首先,感谢诸位的帮助和参与. 由于我的服务器编程语言是PHP,而网上有很多number2word functions/classes, 很好用. 如有必要改写成javascript 相信也不难. 再一次感谢.
-jsfli06(书法爱好者);
2006-8-17
(#3148816@0)
-
自己写吧我觉得把数字串倒过来以后在转换,看上去不很难的样子。。。
比如123456789.99
倒过来99.987654321
读99 -〉str = 99/100
读9 -〉"nine" + str
读8-〉"eighty" + str
读7-〉"seven hundred" + str
读6-〉“six thousand and” + str
读5-〉“fifty” + str
读4-〉"four hundred" + str
读3-> "three million and " + str
...
str = "..."
-canadiantire(轮胎-cui bono?);
2006-8-16
{340}
(#3146530@0)
-
Thank you for your great help. Thanx.
-jsfli06(书法爱好者);
2006-8-16
(#3146655@0)
-
不好意思,你这思路是错的.1.先把串转成数值.(实际上就是归一化)
2.再把数值转会读出来的串.
否则,直接读很有可能出各种EXCEPTION的情况要处理.
-iwantcar(恶疾,时日无多,戒网);
2006-8-16
{113}
(#3146690@0)