开发者

jQuery: Multiply a number with 7.5

I'm about to design a webshop, build upon the Big Cartel webshop system. The nearest currency they use is Euro, but I want Danish Kroner (DKK), which is 7.5 of Euro.

How can I multiply the number within a div.price?

I've found "jQuery Calculate"-plugin, but I can't figure out how it works.

开发者_如何学JAVA

Plugin site: http://www.pengoworks.com/workshop/jquery/calculation/calculation.plugin.htm

Thank you in advance...


$('div.price').text(function(i,v) {
    return Math.round(parseInt(v * 100, 10) * 7.5) / 100;
});

Live demo: http://jsfiddle.net/tbL5r/


$("div.price").each(function(){
 $(this).text(parseFloat($(this).text()) * 7.5);
});

But you really shouldn't be doing that with javascript.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜