Advertisement
Gromov

Calculator

Oct 21st, 2021
1,243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.25 KB | None | 0 0
  1. <!DOCTYPE html >
  2. <html >
  3. <head>
  4.     <title>Currency Converter</title>
  5.     <script>
  6.  
  7.         function converter(){
  8.             var euro = parseInt(document.getElementById('euro').value);
  9.             var com = parseInt(document.getElementById('com').value);
  10.             var kom = parseInt(document.getElementById('kom').value);
  11.             var convert = document.getElementById('convert').value;
  12.             var cv = document.getElementById('cv12');
  13.             var cv3 = document.getElementById('cv34')
  14.             if(convert == 1){
  15.                 cv.value =   ((100 - (com + kom)) / 100 ) * (euro * 1.9558) ;
  16.                 cv.type = "text";
  17.                 cv3.value = (euro * 1.9558) - cv.value;
  18.                 cv3.type = "text";
  19.             }
  20.             if(convert == 2){
  21.                 cv.value = ((100 - (com + kom)) / 100 ) * (euro * 1.0690);
  22.                 cv.type = "text";
  23.                 cv3.value = (euro * 1.0690) - cv.value;
  24.                 cv3.type = "text";
  25.             }
  26.             if(convert == 3){
  27.                 cv.value = ((100 - (com + kom)) / 100 ) * (euro * 25.615);
  28.                 cv.type = "text";
  29.                 cv3.value = (euro * 25.615) - cv.value;
  30.                 cv3.type = "text";
  31.             }
  32.             if(convert == 4){
  33.                 cv.value = ((100 - (com + kom)) / 100 ) * (euro * 7.4406);
  34.                 cv.type = "text";
  35.                 cv3.value = (euro * 7.4406) - cv.value;
  36.                 cv3.type = "text";
  37.             }
  38.             if(convert == 5){
  39.                 cv.value = ((100 - (com + kom)) / 100 ) * (euro * 0.84290);
  40.                 cv.type = "text";
  41.                 cv3.value = (euro * 0.84290) - cv.value;
  42.                 cv3.type = "text";
  43.             }
  44.             if(convert == 6){
  45.                 cv.value = ((100 - (com + kom)) / 100 ) * (euro * 7.5132);
  46.                 cv.type = "text";
  47.                 cv3.value = (euro * 7.5132) - cv.value;
  48.                 cv3.type = "text";
  49.             }
  50.             if(convert == 7){
  51.                 cv.value = ((100 - (com + kom)) / 100 ) * (euro * 363.39);
  52.                 cv.type = "text";
  53.                 cv3.value = (euro * 363.39) - cv.value;
  54.                 cv3.type = "text";
  55.             }
  56.             if(convert == 8){
  57.                 cv.value = ((100 - (com + kom)) / 100 ) * (euro * 9.7065);
  58.                 cv.type = "text";
  59.                 cv3.value = (euro * 9.7065) - cv.value;
  60.                 cv3.type = "text";
  61.             }
  62.             if(convert == 9){
  63.                 cv.value = ((100 - (com + kom)) / 100 ) * (euro * 4.6030);
  64.                 cv.type = "text";
  65.                 cv3.value = (euro * 4.6030) - cv.value;
  66.                 cv3.type = "text";
  67.             }
  68.             if(convert == 10){
  69.                 cv.value = ((100 - (com + kom)) / 100 ) * (euro * 4.9467);
  70.                 cv.type = "text";
  71.                 cv3.value = (euro * 4.9467) - cv.value;
  72.                 cv3.type = "text";
  73.             }
  74.             if(convert == 11){
  75.                 cv.value = ((100 - (com + kom)) / 100 ) * (euro * 10.0145);
  76.                 cv.type = "text";
  77.                 cv3.value = (euro * 10.0145) - cv.value;
  78.                 cv3.type = "text";
  79.             }
  80.  
  81.  
  82.         }
  83.     </script>
  84.     <head>
  85. <body>
  86. <form action="#" method="post" name="cc">
  87.     Darijuma summa: <input id="euro" type="text" name="euro" >EUR<br>
  88.     Darijuma valuta: <select name="convert" id ="convert" >
  89.     <option value="0">Select the Currency</option>
  90.     <option value="1">BGN</option>
  91.     <option value="2">CHF</option>
  92.     <option value="3">CZK</option>
  93.     <option value="4">DKK</option>
  94.     <option value="5">GBP</option>
  95.     <option value="6">HRK</option>
  96.     <option value="7">HUF</option>
  97.     <option value="8">NOK</option>
  98.     <option value="9">PLN</option>
  99.     <option value="10">RON</option>
  100.     <option value="11">SEK</option>
  101. </select><br>
  102.     Bankas komisija: <input id="com" type="text" name="comm" value="2">%<br>
  103.     EU komisija: <input id="kom" type="text" name="kom">%<br>
  104.     <input type="button" name="submit" value="Convert" onclick="converter()">
  105. </form><br>
  106. Komisija: <input type="hidden" name="cv3" id="cv34" readonly><br>
  107. Gala summa: <input type="hidden" name="cv" id="cv12" readonly />
  108. </body>
  109.  
  110. <html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement