我需要重新組織價格字符串第一個值是1.778,81我需要最後值2.099,00代碼belove結果像我需要的2099,00。在從最後的第6個字符之前。插入字符之前第6個字符從最後jquery
$.each($(".indirimsiz_urun_fiyati span"), function(index) {
var KDVsiz = $(this).html().replace(' TL + KDV', '');
var KDVsiz = (KDVsiz).replace(/\./g,"");
var KDVsiz = (KDVsiz).replace(/,/g,".");
var KDVsiz = (parseFloat(KDVsiz,10) * 1.18).toFixed(2);
var KDVsiz = (KDVsiz).replace(/\./g,",");
$(this).text(KDVsiz + ' TL');
});
如果你在GOOGLE上搜索,你可能會發現這一點:http://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas- as-thousands-separator-in-javascript – Michiel 2013-05-01 08:53:40