RP_Search/app/static/js/currency.js
Virág Gábor 80b26a39c6 upload
2024-11-06 11:01:28 +01:00

9 lines
394 B
JavaScript
Executable file

const convert = (n1, n2, conversionFactor) => {
// id's for currency input boxes
let id1 = "cb" + n1;
let id2 = "cb" + n2;
// getting the value of the input box that just got filled
let inputBox = document.getElementById(id1).value;
// updating the other input box after conversion
document.getElementById(id2).value = ((inputBox * conversionFactor).toFixed(2));
}