diff --git a/sites/home/decoder/decoder.js b/sites/home/decoder/decoder.js index 63c70c8..c5a0064 100644 --- a/sites/home/decoder/decoder.js +++ b/sites/home/decoder/decoder.js @@ -19,9 +19,9 @@ const ZEROES_FOR_PADDING = '00000000'; function renderOutput({ bucketInBinary, valueInBinary }) { document.querySelector('.decoder__bucket--binary').innerHTML = bucketInBinary; - document.querySelector('.decoder__bucket--decimal').innerHTML = BigInt(parseInt(bucketInBinary, 2)); + document.querySelector('.decoder__bucket--decimal').innerHTML = BigInt(`0b${bucketInBinary}`); document.querySelector('.decoder__value--binary').innerHTML = valueInBinary; - document.querySelector('.decoder__value--decimal').innerHTML = BigInt(parseInt(valueInBinary, 2)); + document.querySelector('.decoder__value--decimal').innerHTML = BigInt(`0b${valueInBinary}`); } // Converts the number to a binary string