decimals
specify_decimal <- function(x, k) trimws(format(round(x, k), nsmall=k))
# Then to apply to several columns: this adds one decimal spot.
dat[c(4,5,7:10)] = lapply(dat[c(4,5,7:10)], specify_decimal, 1)
specify_decimal <- function(x, k) trimws(format(round(x, k), nsmall=k))
# Then to apply to several columns: this adds one decimal spot.
dat[c(4,5,7:10)] = lapply(dat[c(4,5,7:10)], specify_decimal, 1)