Upload files to "/"
This commit is contained in:
commit
79e7d5ed27
20
szamrendszer.js
Normal file
20
szamrendszer.js
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
function convertNumber(num) {
|
||||||
|
if (isNaN(num)) {
|
||||||
|
return "Please enter a valid number.";
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
binary: num.toString(2),
|
||||||
|
decimal: num.toString(10),
|
||||||
|
hexadecimal: num.toString(16).toUpperCase()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const number = 255;
|
||||||
|
console.log(convertNumber(number));
|
||||||
|
|
||||||
|
{
|
||||||
|
"binary"; "11111111",
|
||||||
|
"decimal"; "255",
|
||||||
|
"hexadecimal"; "FF"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user