dn <- 1.0
sprintf("%.1f",dn)
# [1] "1.0"
sprintf("%.2f",dn)
# [1] "1.00"
sprintf("%.22f",dn)
# [1] "1.0000000000000000000000"
dc == sprintf("%.1f",dn)
#[1] TRUE
dn
is stored internally as double precision float ("numeric" in R). How you display it is up to you.