@Override public String format(double value,int formatNumber){
  if (formatNumber % 2 == 0) {
    return format.format(value);
  }
 else {
    return null;
  }
}

@ Override public String format ( double value , int formatNumber ) { if ( formatNumber % 2 == 0 ) { return format . format ( value ) ; } else { return null ; } }
returns the formatted value . returns null if the value does not start with 1 .
