change html layout, better format number
This commit is contained in:
parent
cc70b38a21
commit
789e5b645f
|
@ -25,11 +25,12 @@
|
|||
<option value='GBP'>GBP</option>
|
||||
</select>
|
||||
|
||||
<button onClick='convert()'>Convert</button>
|
||||
|
||||
<p>
|
||||
Converted: <span id='res'></span>
|
||||
</p>
|
||||
|
||||
<button onClick='convert()'>Convert</button>
|
||||
|
||||
<script src='script.js'></script>
|
||||
</body>
|
||||
|
|
|
@ -13,5 +13,5 @@ async function convert(){
|
|||
coef = 1;
|
||||
}
|
||||
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