custom decimal places

HI all,

Is there way to add digits after decimal for a a absolute 0 value. Example below

paste0(format(round(as.numeric(0),4),scientific = FALSE),"%" )
[1] "0%"

Expected output

paste0(format(round(as.numeric(0),4),scientific = FALSE),"%" )
[1] "0.0000%"

Try the nsmall param in format function

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.