   else
     undefined
 
+format4f = (number) ->
+  if number
+    number.toFixed(4).replace(/\.0+$/, '.0')
+  else
+    number
+
 combineTables = (tables) ->
   leader = head tables
 

  inspectFrameColumns = (tableLabel, frameKey, frame, frameColumns) -> ->
    attrs = [
      'label'
      'missing_count'
      'zero_count'
      'positive_infinity_count'
      'negative_infinity_count'
      'min'
      'max'
      'mean'

      #XXX format functions
      switch column.type
        when 'int', 'real'
          createVector column.label, TNumber, (parseNaNs column.data), format4f
        when 'enum'
          domain = column.domain
          createFactor column.label, TString, ((if index? then domain[index] else undefined) for index in column.data)
