How to Convert Decimal Values into Hexadecimal Values

This guide teaches you how to convert decimal values into hexadecimal ones. You can also apply this to other bases, not just hexadecimal.

Materials
  • 4 properties
  • 1 trigger
Set Up
  • First, configure your properties to have an input number property and output a text property, and 2 values both number properties.
  • Then configure your trigger so it has 2 block code slots with 8 variables, 4 for each.
The Code

Here is the second block code slot.

How it Works
  • So first, you must understand how to go from hexadecimal to decimal. You divide by 16, then the remainder is your hexadecimal value. Repeat with the quotient. But there is no way to get the remainder in gkc easily. The way it’s done here is we divide our number, then round down, multiply it by 16, then subtract it from the original, and this gives us our remainder. We add one so that it never equals 0, which would result in no value. The rest of the system you should be able to comprehend if you got this far.
6 Likes

You should talk about how to apply this, maybe add ways that people can modify it? Like a binary-hex converter? (Would be useful for homework…)
But overall, cool guide. Nice formatting.

1 Like

It’s a nice guide I just cant figure out how you would use it in a Gimkit game also I just don’t really understand it.