Word到Word - jquery [英] Number to Word - jquery
本文介绍了Word到Word - jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都知道一种描述现金价值或插件的方法吗?
Anyone know's a way to describe a cash value or a plugin who does that ?
exp:如果我有$ 1.200.000 ,00和用户 hover()
价值:
描述将是一百二百
exp: if i have $ 1.200.000,00 and the user hover()
the value:
description will be "one million two hundred "
谢谢!
推荐答案
以下页面提到了一个非常简单的实现:
The following page mentions a very simple implementation:
可以使用此功能执行转换:
which can perform the conversion by using this function:
var words = toWords(num);
使用jQuery,你可以将它包装在你的悬停函数中,如下所示:
Using jQuery, you can wrap this inside of your hover function, as shown below:
//This will add a tooltip upon hovering with the "word" value.
$('div').hover(function(){
$(this).attr('title',toWords($(this).text()));
});
Working Demo
这篇关于Word到Word - jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文