# Create vector
a <- c(1.3243, 5.9783, 2.3848)
# Assign format attributes
a <- fattr(a, format = "%.1f", width = 10, justify = "center")
# Apply format attributes
fapply(a)
# [1] " 1.3 " " 6.0 " " 2.4 "
Run the code above in your browser using DataLab