I am computing values, which are essentially decimal values and am also supposed to report them in a table. For the sake of neat presentation, how can I round all the values to 3 decimal places and even force R to add the 0's for the values with less that 3 decimal places? Here is a more practical example:
# The following vector contains all the values I computed (this is an example)
results <- c(1.25854, 3.2, 2.84)
# I am currently using the round() function, which does not give me the desired result
rounded_results <- round(results, 3)
rounded_results
> [1] 1.259 3.2 2.84
# The result I would like to obtain is
> [1] 1.259 3.200 2.840