Adding the explanation...Explanation:
l Implicit input, get length
┼ Input again
x To hex
l Get length
2+ Add 2 because of "0x"
┼ Get input again
D Duplicate on the stack
RîsR Remove zeroes at the end (reverse, to int, to string, reverse)
l Get length (= length of base)
≥ Add 1 because to count "e" in the scientific notation
a Swap top two values on the stack
l≤ Get length - 1 ( = get the exponent of 10 in scientific notation)
D Duplicate on the stack
l Get length ( = length of the exponent)
a Swap. Now on top of the stack we have the exponent again
° 10^exponent
Ō Get input for the fourth time
a/ Divide input by the 10^exp calculated earlier
ì\? If this thing is not an integer...
≥; ...add one to count the "."
+ Sum base length ( + "e") + exponent length ( + ".")
W Wrap stack in array
D Duplicate
╤k Get index of min value