title: BIRT: Number type (formats) hell
body: <p>Birt supports 3 number/digits types (e.g. for output columns in dataset):</p>
  
  <ul>
  <li><code>Integer</code></li>
  <li><code>Decimal</code></li>
  <li><code>Float</code></li>
  </ul>
  
  <p>At the same time, BIRT has the only 1 (yes! ONE!!!) css build-in format for numbers. That means if you have, for instance int (days) and decimal (amounts) you can't use build-in css style for them (you have define own and apply them on each item).</p>
  
  <p>Go further. You call Java class from BIRT and pass to it so called <code>Integer</code> value. What you get at Java? Correct <code>Double</code>. At it's no way to now at that level that originally we have <code>Integer</code> value. </p>
  
  <p>Of course in some cases you could try to guess data type based on a value. 
  E.g.</p>
  
  <pre><code>    public Object formatFromBirt(Object pObject){
      if (pObject == null) return null;
      ...
      if (pObject instanceof Double) {
          // workaround for int as double (e.g. days in arrear in total)
          LWDecimal dec = new LWDecimal((Double)pObject);
          if (dec.getScale() == 0){
              pObject = dec.getJavaDecimal().toBigInteger();
          }
      }
      return formatObject(pObject);
  }
  </code></pre>
  
  <p>My BIG Question is - guys, <strong>how you handle all that hecking mess in BIRT number type system</strong>?</p>