5212g is more precise than 5kg because you know more digits to the measurement so it is more accurate.
If the answer was 5212g and you put 5kg then like there's so many questions to ask about that 5kg. For example, is it exactly 5kg or is there more or less.