// locale-sensitive parse

import java.lang.Number;

//...

double doubleResult = 0.;
long longResult = 0;
Number n = nf.parse ( "-2,123.45" );
if ( n instanceof Long )
   {
   longResult = ( (Long)n ).longValue ();
   }
else if ( n instanceof Double )
   {
   doubleResult = ( (Double)n ).doubleValue ();
   }
// locale sensitive format
String display = nf.format( 88899L );