The answer on the image would be 40,065.
The answer for the question being asked is 6,090,003.
To find the problem you have you would sort each number in a certain level. For 6 million it would be sorted into the one million because it is a single digit in the million. The 90 thousand would be sorted into the 10 thousands because it is not over 100 thousand. Next would be 3 which is just a single number where you would put at the end.