How to use formatC so that numbers as a result of a simple arithmetic operation are correct?
Advertisements The function formatC() produces wrong formats of numbers when a simple arithmetic operation is passed as x. Example: formatC(29, width = 3, format = "d", flag = "0") > "029" This is correct. But when I do: formatC(100*0.29, width = 3, format = "d", flag = "0") > "028" What am I missing here?… Read More How to use formatC so that numbers as a result of a simple arithmetic operation are correct?