For converting decimal to any base given the range of values