Round if x is numeric, otherwise don't

round_if(df, d)

Arguments

df

data.frame whose columns I want to round

d

number of digits