如何将Number转换为带有额外字符串的字符串 [英] How do I convert Number to string with extra strings
本文介绍了如何将Number转换为带有额外字符串的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将数字转换为字符串....
例如。
< big>
I want to convert number to string....
for eg.
var str='95 HP to 60 HP';
var a= numToStr(str);
现在numToStr()应该返回95 HP到60 HP。
其中numToStr()是执行此转换的函数。
您可以使用任何语言编写javascript或vb或c#。
提前编译。
now numToStr() should return Ninety five HP to Sixty HP.
where numToStr() is the function that does this conversion.
You can code in any language either javascript or vb or c#.
thanx in advance.
推荐答案
拆分数字部分,然后在此处查看:将数字转换为等效的单词。 [ ^ ]
如果这没有帮助,请坐下来做自己的功课!
Split out the numeric parts, and then see here: Converting numbers to the word equivalent. [^]
If that doesn't help, sit down and do your own homework!
查看人性化库。
它包含一个.net实现的数字到单词功能。
希望它有所帮助,
Hi,
Have a look at the humanizer library.
It contains a .net implementation of the number to words functionality.
Hope it helps,
检查此网址:
http://jsfiddle.net/alisentas / wf9g9 / [ ^ ]
这篇关于如何将Number转换为带有额外字符串的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文