title: awk / gawk printf when variable format string, changing zero to dash
body: <p>I have a table of numbers I am printing in awk using <code>printf</code>.<br>
  The <code>printf</code> accomplishes some truncation for the numbers.</p>
  
  <pre><code>(cat &lt;&lt;E\OF
  Name,Where,Grade
  Bob,Sydney,75.12
  Sue,Sydney,65.2475
  George,Sydney,84.6
  Jack,Sydney,35
  Amy,Sydney,
  EOF
  )|gawk 'BEGIN{FS=","}
  FNR==1 {print("Name","Where","Grade");next}
  {if ($3&lt;50) {$3=0}
  printf("%s,%s,%d \n",$1,$2,$3)}'
  </code></pre>
  
  <p>This produces:</p>
  
  <pre><code>Name Where Grade
  Bob,Sydney,75 
  Sue,Sydney,65 
  George,Sydney,84 
  Jack,Sydney,0 
  Amy,Sydney,0 
  </code></pre>
  
  <p>What I want is to display scores which are less than 50, or missing, as a dash ("-").</p>
  
  <pre><code>Name Where Grade
  Bob,Sydney,75 
  Sue,Sydney,65 
  George,Sydney,84 
  Jack,Sydney,- 
  Amy,Sydney,- 
  </code></pre>
  
  <p>This requires the 3rd string format in  <code>printf</code> change from %d to %s.
  So in some rows, the third column should be a value, and in some rows, the third column should be a string.  How can I tell this to GAWK?  Or should I just pipe through another awk to re-format?</p>