Rounding currency formatted numbers in DT
<p>I'm trying to get the numbers in a currency format and then round them but I get unexpected behaviour from <code>DT</code> (v 0.1).</p>

<p>I want the values looking like <code>808084.227872401</code> into <code>£808,084.2</code></p>

<p>Here's the code:</p>

<pre><code>library(DT)

m &lt;- structure(list(A = c(808084.227872401, 1968554.9592654, 751271.053745238, 
-248530.769710688, 1022891.09543523, -407303.626363765), B = c(143073.342325492, 
-1440469.87343229, -590080.736184761, -608299.78907882, 1167155.65688074, 
803870.898483576), C = c(-447086.9382469, 606572.488852836, 89371.3745637198, 
-1496047.6143101, -410103.544644035, 1106358.3287006), D = c(0.754009573487565, 
0.364774209912866, 0.525769896339625, 0.44853704655543, 0.909551323624328, 
0.439131782157347), E = c(98.8604132297185, 98.9055931760521, 
99.3795062166865, 98.5895350315005, 101.194549174315, 102.325111315431
)), .Names = c("A", "B", "C", "D", "E"), row.names = c(NA, -6L
), class = "data.frame")
</code></pre>

<p>According to <a href="https://rstudio.github.io/DT/functions.html" rel="noreferrer">documentation</a> this should work:</p>

<pre><code>datatable(m) %&gt;% formatCurrency("A", "£", digits = 1)
</code></pre>

<p>But I get the following error:</p>

<blockquote>
  <p>Error in formatCurrency(., "A", "£", digits = 1) : 
   unused argument (digits = 1)</p>
</blockquote>

<p>Then I tried another command:</p>

<pre><code>datatable(m) %&gt;% formatCurrency("A", "£") %&gt;% formatRound("A", 1)
</code></pre>

<p>But it only formatted the currency without rounding it.</p>

<p><a href="https://i.stack.imgur.com/g2AjX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/g2AjX.png" alt="enter image description here"></a></p>

<p>Any ideas?</p>

<p>PS. I'm aware of <a href="https://stackoverflow.com/questions/29242011/add-comma-to-numbers-every-three-digits-in-datatable-r">this</a> answer, but I don't want to display strings because I want to sort the numbers when displayed with <code>datatable</code>.</p>