csv export adding unwanted decimal end of the numbers

hi ı have a df and ı use this code to export it. then seen in picture adding some extra numbers . how can ı correct this situation. thanks.
readr::write_delim(SYS_BIND, file="D://SYS_BIND.csv", col_names = TRUE, delim = ";", eol='\r\n')

The write_delim() function is not adding extra digits. The numbers shown are the actual value of your data frame. Not all numbers can be written exactly using a limited number of binary bits. The "extra" numbers are a result of the limited precision of the computer. Are these extra digits causing a problem?

Yes this extra numbers are problem when export to csv

İn the result page rstudio window numbers are 4 digit after decimal. I see 4 digit in the result page but when ı export it to csv extra numbers come ....

Have you tried using the round() function on that numeric column of your data frame? You will have to be sure that you only want a certain precision in all cases.

ifelse(is.numeric((a / b)), round((a / b), 4), a / b)
yes ı used as above

What you see on screen is rounded for visualization purposes but the actual value stored in memory is what you see on the csv file.

Maybe you are not storing the changes and that is why you keep getting the full precision value on the csv file. To help us help you, can you turn this into a proper REPRoducible EXample (reprex) illustrating your issue? It would make it easier to give you a working solution.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.