base number conversions
This file cannot be displayed:
In the first function of the of the program, it converts a base 10 number into a base 4 number, however it drops the leading zero if there are leading zeros in the base 4 number. how do I program it to keep the leading zeros.
How would I code this to be able to covert a batch of base 4 numbers to decimal or base 10 and vice versa?
There is no default way for saving the leading zeroes that I know of. A workaround that I can suggest is to first convert the number to a string and then save the leading zeroes in another string and after converting the number, just join the already saved leading zeroes and the new number converted to string.