let rotated = true; const EDKURS = 1.0848;// 25.07.2024 //0.981; function calcD() { let euro = txtvar1.value.replace(',','.'); let result = euro * EDKURS; console.log(result); try{ txtvar2.value = result.toFixed(2).replace('.',','); }catch(e){ console.error(e); txtvar2.value = result.toFixed(2); } let u = document.getElementById("umrechnung"); u.style.transform = 'rotate(180deg)'; rotated = true; u.setAttribute("title","Euros in Doller"); } function calcE() { let doller = txtvar2.value.replace(',','.'); let result = doller / EDKURS; try { txtvar1.value = result.toFixed(2).replace('.',','); }catch(e){ console.error(e); txtvar1.value = result.toFixed(2); } let u = document.getElementById("umrechnung"); u.style.transform = 'rotate(0deg)'; rotated = false; u.setAttribute("title","Doller in Euros"); } function umrechnungDrehen() { const compStyles = window.getComputedStyle(umrechnung); let transform = compStyles.getPropertyValue('transform'); //alert(transform); let u = document.getElementById("umrechnung"); if(rotated == true){ u.style.transform = 'rotate(0deg)'; u.setAttribute("title","Doller in Euros"); }else{ u.style.transform = 'rotate(180deg)'; u.setAttribute("title","Euros in Doller"); } rotated = !rotated; transform = compStyles.getPropertyValue('transform'); //alert(transform); }