I'm trying to format a table in a shiny app. I'm using the datatable
function in the DT package. I have columns with values like xxx.yyy, x.y, x.yyyyy, x
. I'd like to format these as xxx.yy, x.y0, x.yy, x.00
. The formatRound('colName', 'digits') function takes care of xxx.yyy (formatRound(x = xxx.yyy, 2) but doesn't add the trailing zero(s).
The formatRound (and other format* functions in DT) are wrappers for some javascript code. Is there some addition to this code that would pad with zeros?