title: Formatting numbers read from spreadsheet
body: <p>I'm writing a script that creates fixed-width-text output of the contents of a Google Apps Spreadsheet. I retrieve all the values of the current range using the <code>range.getValues()</code> method, then I loop through everything a couple times and generate a block of text that looks like a nicely-formatted table when pasted into a fixed-width-font email.</p>
  
  <p>The only issue I'm having is that I cannot replicate the number formatting. I can get the number formatting string using <code>range.getNumberFormats()</code>, but I cannot find a method for applying that formatting string within code. I tried using the TEXT (value, format) spreadsheet function, but apparently Google Apps Script does not yet support calling spreadsheet functions from within the JavaScript code itself (see <a href="http://code.google.com/p/google-apps-script-issues/issues/detail?can=2&amp;q=26&amp;colspec=Stars%20Opened%20ID%20Type%20Status%20Summary%20Priority%20Component%20Owner&amp;id=26">this issue</a> for proof).</p>