Compare commits
3 Commits
49f59d0f86
...
2c6311ad88
Author | SHA1 | Date | |
---|---|---|---|
2c6311ad88 | |||
789e5b645f | |||
cc70b38a21 |
17
index.html
17
index.html
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="author" content="Arnau Busom i Vidal">
|
<meta name="author" content="Arnau Busom i Vidal">
|
||||||
<title>Conversor</title>
|
<title>Currency Converter</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -13,6 +13,11 @@
|
||||||
<option value='SEK'>SEK</option>
|
<option value='SEK'>SEK</option>
|
||||||
<option value='JPY'>JPY</option>
|
<option value='JPY'>JPY</option>
|
||||||
<option value='GBP'>GBP</option>
|
<option value='GBP'>GBP</option>
|
||||||
|
<option value='INR'>INR</option>
|
||||||
|
<option value='ISK'>ISK</option>
|
||||||
|
<option value='DKK'>DKK</option>
|
||||||
|
<option value='RON'>RON</option>
|
||||||
|
<option value='NOK'>NOK</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<input type='number' id='val' step='0.01'>
|
<input type='number' id='val' step='0.01'>
|
||||||
|
@ -23,13 +28,19 @@
|
||||||
<option value='SEK'>SEK</option>
|
<option value='SEK'>SEK</option>
|
||||||
<option value='JPY'>JPY</option>
|
<option value='JPY'>JPY</option>
|
||||||
<option value='GBP'>GBP</option>
|
<option value='GBP'>GBP</option>
|
||||||
|
<option value='INR'>INR</option>
|
||||||
|
<option value='ISK'>ISK</option>
|
||||||
|
<option value='DKK'>DKK</option>
|
||||||
|
<option value='RON'>RON</option>
|
||||||
|
<option value='NOK'>NOK</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<button onClick='convert()'>Convert</button>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Quantitat convertida: <span id='res'></span>
|
Converted: <span id='res'></span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<button onClick='convert()'>convertir</button>
|
|
||||||
|
|
||||||
<script src='script.js'></script>
|
<script src='script.js'></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -13,5 +13,5 @@ async function convert(){
|
||||||
coef = 1;
|
coef = 1;
|
||||||
}
|
}
|
||||||
var val = document.getElementById('val').value;
|
var val = document.getElementById('val').value;
|
||||||
document.getElementById('res').textContent = val*coef + ' ' +document.getElementById('curr2').value;
|
document.getElementById('res').textContent = Number((val*coef).toFixed(2)).toLocaleString('en') + ' ' +document.getElementById('curr2').value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user