question: 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 ( ) ; }
target:  Return number as string for INSERT statements with correct precision