Merhaba arkadaşlar, bölme işlemi yapıyorum ama ondalık sayısı baya uzun çıkıyor. Onu iki haneye nasıl düşürebilirim.
$.ajax({
url: 'index.php?route=product/product/chi',
data: postData,
type: 'post',
dataType: 'json',
success: function(json)
{
for ( var i = nos; i < en; i++ ) {
$('#ddd-' + i).children('option:not(:first)').remove();
}
$.each(json, function(e,item){
var f = $( "#ddd option:selected" ).data('id');
if (item['serb'] == '-0-'||item['serb'].indexOf(f) >= 0){
html += '<option data-id="' + item['ovd'] + '" value="' + item['value'] + '">' + item['name'];
if (item['price'] > 0) {
html += ' (Fiyat: ' + item['ovd'] / item['pricet'] + ' TL)';
}}
html += '</option>';
})
$('#ddd-' + nos).append(html);
}
})
}
$(document).on('change', '[id^=ddd]', b);
//--></script> html += ' (Fiyat: ' + item['ovd'] / item['pricet'] + ' TL)';
Bu kısmı bölymeye çevirdim. Ama sonuç 15,4542145545 gibi bir sonuç veriyor.