change html layout, better format number
This commit is contained in:
parent
cc70b38a21
commit
789e5b645f
|
@ -25,11 +25,12 @@
|
||||||
<option value='GBP'>GBP</option>
|
<option value='GBP'>GBP</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<button onClick='convert()'>Convert</button>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Converted: <span id='res'></span>
|
Converted: <span id='res'></span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<button onClick='convert()'>Convert</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