public String TO_NUMBER(BigDecimal number,int displayType){
  if (number == null)   return "NULL";
  BigDecimal result=number;
  int scale=DisplayType.getDefaultPrecision(displayType);
  if (scale > number.scale()) {
    try {
      result=number.setScale(scale,BigDecimal.ROUND_HALF_UP);
    }
 catch (    Exception e) {
    }
  }
  return result.toString();
}

public String TO_NUMBER ( BigDecimal number , int displayType ) { if ( number == null ) return "NULL" ; BigDecimal result = number ; int scale = DisplayType . getDefaultPrecision ( displayType ) ; if ( scale > number . scale ( ) ) { try { result = number . setScale ( scale , BigDecimal . ROUND_HALF_UP ) ; } catch ( Exception e ) { } } return result . toString ( ) ; }
return number as string for insert statements with correct precision
