有谁知道描述现金值(value)的方法或执行此操作的插件吗?
exp: 如果我有 $1.200.000,00 并且用户 hover()
值:
描述将是“一百万”
谢谢!
最佳答案
下一页提到了一个非常简单的实现:
可以使用这个函数进行转换:
var words = toWords(num);
使用 jQuery,您可以将其包装在悬停函数中,如下所示:
//This will add a tooltip upon hovering with the "word" value.
$('div').hover(function(){
$(this).attr('title',toWords($(this).text()));
});
关于javascript - 数字到 Word - jquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7257575/