title: How to suppress zero printing in a table (zero.print="" not working)
body: <p>I have diagonal matrices with NAs and zeros I want to hide. </p>
  
  <p>na.print = "" is working fine, but zero.print = "." seems to treating 0.00 as != 0 ?</p>
  
  <p>Here's a runnable example with print out so you can see what I mean:</p>
  
  <pre><code>x &lt;- matrix(c(0.01, NA, NA, NA, 0.00, 0.00, NA, NA, 0.00, 0.00, -0.01, NA, 0.00, 0.00, 0.00, 0.00), nrow=4, byrow=TRUE)
  x
           [,1] [,2]  [,3] [,4]
      [1,] 0.01   NA    NA   NA
      [2,] 0.00    0    NA   NA
      [3,] 0.00    0 -0.01   NA
      [4,] 0.00    0  0.00    0
  
  print.table(x, na.print="", zero.print=".")
           [,1]  [,2]  [,3]  [,4] 
      [1,]  0.01                  
      [2,]  0.00  0.00            
      [3,]  0.00  0.00 -0.01      
      [4,]  0.00  0.00  0.00  0.00
  </code></pre>
  
  <p>Following the helpful answers below (thanks guys!), and based on the explicit choice in print.table to not zero.print items where any item in the table fails (x == round(x)), here's a version which works with floating.point. I wrote it for a dataframe printing task, but it works with matrices.</p>
  
  <pre><code>print.dataframe &lt;- function (x, digits = getOption("digits"), quote = FALSE, na.print = "", zero.print = "0", justify = "none", ...){
      xx &lt;- format(x, digits = digits, justify = justify)
      if (any(ina &lt;- is.na(x))) 
          xx[ina] &lt;- na.print
      i0 &lt;- !ina &amp; x == 0
      if (zero.print != "0" &amp;&amp; any(i0)) 
          xx[i0] &lt;- zero.print
      if (is.numeric(x) || is.complex(x)){
          print(xx, quote = quote, right = TRUE, ...)
      }else{
          print(xx, quote = quote, ...)   
      }
      invisible(x)
  }
  
  print.dataframe(bob, zero.print = ".", justify="left")
  </code></pre>