我使用greasmonkey脚本将特定页面中的货币转换为使用API的INR。 我能够获得美元兑印度卢比的当前货币汇率,也能够将货币符号替换为印度卢比,但不能将货币值转换为当前汇率。我正在使用以下脚本:greasemonkey货币转换器
$(function(){
GM_xmlhttpRequest({
method: "GET",
url: "http://www.google.com/ig/calculator?hl=en&q=1usd=?inr",
onload: function(d){
d=JSON.stringify(eval("(" + d.responseText + ")"));
d=$.parseJSON(d);
p=Math.round(d.rhs.replace(/[^\d\.]/g, ''));
var replaced=$('body').html().replace(/\$(?:\s+)*(\d+\,\.)?/g, '₹$1');
$('body').html(replaced);
}
});
});
上述脚本将$ s的所有出现都替换为Rs。在一个页面,如:
$0.50, $1.00, $20.00, $200.00
到
₹0.50, ₹1.00, ₹20.00, ₹200.00
,但我想要的是货币转换也与汇率这样的:
₹29.5, ₹59, ₹1180, ₹11800
我没有得到这个高达..
PLease help ..
**OR SOMEONE HAVE BETTER IDEA TO DO THIS CONVERSION. PLZ SUGGEST**
能否请你告诉一个链接到你所创建的Greasemonkey的脚本?此外,它是可定制的,并可以在任何网站上工作? –