I'm trying print to console or even inspect the numbers inside my dataframe object that contains big decimal numbers with 8 decimal places such as: "1054792997932.50564756" (the class of the number is numeric
)
I tried using print()
and cat()
and View()
to inspect a single number but the only result I get back is and integer "1054792997932" and the decimal places cannot be seen unless I use sprintf("%.8f", number)
but the output I get back is the wrong number:
> sprintf("%.8f", 1054792997932.50564756)
[1] "1054792997932.50561523"
So from the looks of it sprintf
is not a good method to use to check or format big decimal numbers.
I'm having problems validating and working with rounding such numbers any advice/help you can provide on how to deal with numbers in R would be appreciated as I am stuck
The system setup is:
R version: 3.4.0
I use pretty standard packages:
R stats and R Utils