Update szamrendszer.js
This commit is contained in:
parent
bdd1c2b323
commit
ccd306a7d8
|
@ -9,7 +9,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
function convertNumber(value, fromBase, toBase) {
|
function convertNumber(value, fromBase, toBase) {
|
||||||
let decimalValue;
|
let decimalValue;
|
||||||
|
|
||||||
// Convert input to decimal first
|
|
||||||
switch (fromBase) {
|
switch (fromBase) {
|
||||||
case "bináris":
|
case "bináris":
|
||||||
decimalValue = parseInt(value, 2);
|
decimalValue = parseInt(value, 2);
|
||||||
|
@ -31,7 +30,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
return "Érvénytelen szám";
|
return "Érvénytelen szám";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert decimal to target base
|
|
||||||
switch (toBase) {
|
switch (toBase) {
|
||||||
case "bináris":
|
case "bináris":
|
||||||
return decimalValue.toString(2);
|
return decimalValue.toString(2);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user