# Can anyone give me a suggestion to make an app to convert decimal to binary?

**URL:** <https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636>\
**Category:** Canvas / Gaming\
**Created:** [December 22, 2022, 11:40am UTC](https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636 "2022-12-22T11:40:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tpocwgf02x](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@tpocwgf02x](https://community.thunkable.com/u/tpocwgf02x)\
**Post date:** [December 22, 2022, 11:40am UTC](https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636/1 "2022-12-22T11:40:19Z")

</div>

I can not create a code to convert numbers from decimal to binary, can anyone give me a hand or a suggestion?

 ![BINARIO](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/d/1d4c4916231a69dc25edd2e4aa8f747383e95ecd.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 22, 2022, 12:53pm UTC](https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636/2 "2022-12-22T12:53:50Z")

</div>

When I Google _convert decimal to binary algorithm_, I get this:

> Step 1: Divide the number by 2 and find the remainder, then store the remainder in an array.
> 
> Step 2: Divide the number by 2.
> 
> Step 3: Repeat the above two steps until the number is greater than zero.
> 
> Step 4: Print the array in reverse order to get the binary representation of the number.

Have you tried that?

---

<div class="post-metadata">

**Author:** ![tpocwgf02x](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@tpocwgf02x](https://community.thunkable.com/u/tpocwgf02x)\
**Post date:** [December 22, 2022, 1:31pm UTC](https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636/3 "2022-12-22T13:31:01Z")

</div>

thank you

---

<div class="post-metadata">

**Author:** ![tpocwgf02x](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@tpocwgf02x](https://community.thunkable.com/u/tpocwgf02x)\
**Post date:** [December 22, 2022, 4:28pm UTC](https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636/4 "2022-12-22T16:28:25Z")

</div>

it doesn’t work, tell me if I did something wrong in writing the code. even if it doesn’t seem like it

---

<div class="post-metadata">

**Author:** ![tpocwgf02x](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@tpocwgf02x](https://community.thunkable.com/u/tpocwgf02x)\
**Post date:** [December 22, 2022, 4:53pm UTC](https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636/5 "2022-12-22T16:53:43Z")

</div>

![binario2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/e/4e86847350b2014e2ede0295243e2e0bf49e54ba.png)  
I tried both codes but it always gives me 0, for example I insert 10 which should give me 101 and it gives me 0

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 22, 2022, 7:52pm UTC](https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636/6 "2022-12-22T19:52:59Z")

</div>

Why are you adding BINARIO to the remainder? That’s not part of the algorithm. It says to add the remainder to an **array** , not an integer as you’re doing. That means you have to start with an empty list and then add an item to the list each time you get a remainder. And then convert the completed list to a text string. Or you could join the remainder to an empty text string to start with. Either way should work.

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [December 22, 2022, 9:34pm UTC](https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636/7 "2022-12-22T21:34:03Z")

</div>

I managed to get it working with this code:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/6/06b20c4410de2d52c92270f17328e636574894b8.png)

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [December 23, 2022, 9:09am UTC](https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636/8 "2022-12-23T09:09:41Z")

</div>

try getting the binary value of 0 (zero)

---

<div class="post-metadata">

**Author:** ![tpocwgf02x](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@tpocwgf02x](https://community.thunkable.com/u/tpocwgf02x)\
**Post date:** [December 23, 2022, 9:28am UTC](https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636/9 "2022-12-23T09:28:42Z")

</div>

thanks

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:12pm UTC](https://community.thunkable.com/t/can-anyone-give-me-a-suggestion-to-make-an-app-to-convert-decimal-to-binary/2188636/10 "2024-11-08T13:12:36Z")

</div>


