Math Operation Problem
-
I can’t print the result or what mistake am I making? I’m trying to set up a OBEB OKEK calculation scenario.
function calculateGCD(a, b) { // Ensure positive values a = Math.abs(a); b = Math.abs(b); // Euclidean algorithm while (b !== 0) { var temp = b; b = a % b; a = temp; } return a; } var ebob; if (fieldname14 == '02') { ebob = calculateGCD(fieldname27, fieldname26); } if (fieldname14 == '03') { ebob = calculateGCD(fieldname27, fieldname26 + fieldname25); } // Sonucu HTML'e yazd?rma i?lemleri jQuery('#calculation-ebob').html(ebob); jQuery('.ebob-aciklama').html('En Büyük Ortak B?len EBOB / OBEB :'); jQuery('.ebob-sonuc').html(ebob + ' TL'); // ebob de?erini d?ndürme return ebob;
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Math Operation Problem’ is closed to new replies.