title: How can I keep pander from dropping trailing zeros?
body: <p>How can I keep pander from dropping the trailing zeros when I'm simultaneously telling it to round values above their respective number of significant figures?</p>
  
  <p>In the following reproducible example, I'm trying to round a column of p-values for two hypothetical variables (male and female).</p>
  
  <pre><code>require(pander)
  
  Gender &lt;- c("Female", "Male")
  p &lt;- c(4.342e-06, 1.325e-05)
  table &lt;- data.frame(Gender, p)
  
  panderOptions('round', 4)
  panderOptions('keep.trailing.zeros', TRUE)
  
  pandoc.table(table,
               round = panderOptions("round"),
               keep.trailing.zeros = panderOptions("keep.trailing.zeros"))
  </code></pre>
  
  <p>What I get, however, is </p>
  
  <pre><code>------------
   Gender   p 
  -------- ---
   Female   0 
  
    Male    0 
  ------------
  </code></pre>
  
  <p>But what I want to get is</p>
  
  <pre><code>----------------
   Gender      p 
  -------- -------
   Female   0.0000 
  
    Male    0.0000
  ----------------
  </code></pre>
  
  <p>How can I make that happen?</p>
  
  <p>**PS: I'm aware of <a href="https://stackoverflow.com/questions/20199176/how-to-set-the-number-of-decimals-in-report-produced-with-knitr-pander">this question</a>, but it does not solve my problem.*</p>
  
  <p>Edit: I'm also aware of the question <a href="https://stackoverflow.com/questions/30538920/keep-trailing-zeros-for-percents-only">here</a>, but the solution there does exactly what I'm trying to keep from happening here, that is, dropping the trailing zeros when I'm trying to round to value that does not contain any significant figures for all my variables. NicE has a solution (which rawr also gave in the aforementioned previous question), but they require converting the values to characters in addition to stacking up extra code, which I would like to avoid if possible.</p>