From the help page of format, nsmall should control the number of digits.
format(0.123456789, nsmall = 10)
[1] "0.1234567890"
format(0.123456789, nsmall = 1)
[1] "0.1234568"
format(0.123456789, nsmall = 2)
[1] "0.1234568"
format(0.123456789, nsmall = 8)
[1] "0.12345679" It adds zeros fine but for format(0.123456789, nsmall = 1) I want the result to be 0.1. I want to format numbers with a fixed number of digits. A combination of round and format + nsmall does the job. sprintf will do it too, but I wondered if the current implementation of nsmall in format is correct. Thanks, Adrian