@Test public void formatUsingResources() { FastDecimalFormat fdf = new FastDecimalFormat( FastDecimalFormat.TYPE_PERCENT, Locale.US, true ); assertEquals( "19.41%", fdf.format( 0.19408569 ) ); }
public String format( final Object parameters ) { if ( parameters == null ) { throw new NullPointerException(); } if ( parameters instanceof Number == false ) { throw new IllegalArgumentException( "Cannot format given Object as a Number" ); } if ( buffer == null ) { buffer = new StringBuffer(); } else { buffer.delete( 0, buffer.length() ); } if ( fieldPosition == null ) { fieldPosition = new DummyFieldPosition(); } else { fieldPosition.clear(); } final StringBuffer stringBuffer = decimalFormat.format( parameters, buffer, new DummyFieldPosition() ); return stringBuffer.toString(); }
FastDecimalFormat implements FastFormat { public String format( final Object parameters ) { if ( parameters == null ) { throw new NullPointerException(); } if ( parameters instanceof Number == false ) { throw new IllegalArgumentException( "Cannot format given Object as a Number" ); } if ( buffer == null ) { buffer = new StringBuffer(); } else { buffer.delete( 0, buffer.length() ); } if ( fieldPosition == null ) { fieldPosition = new DummyFieldPosition(); } else { fieldPosition.clear(); } final StringBuffer stringBuffer = decimalFormat.format( parameters, buffer, new DummyFieldPosition() ); return stringBuffer.toString(); } }
FastDecimalFormat implements FastFormat { public String format( final Object parameters ) { if ( parameters == null ) { throw new NullPointerException(); } if ( parameters instanceof Number == false ) { throw new IllegalArgumentException( "Cannot format given Object as a Number" ); } if ( buffer == null ) { buffer = new StringBuffer(); } else { buffer.delete( 0, buffer.length() ); } if ( fieldPosition == null ) { fieldPosition = new DummyFieldPosition(); } else { fieldPosition.clear(); } final StringBuffer stringBuffer = decimalFormat.format( parameters, buffer, new DummyFieldPosition() ); return stringBuffer.toString(); } FastDecimalFormat( final String pattern );  FastDecimalFormat( final String pattern, final Locale locale );  FastDecimalFormat( final int type, final Locale locale );  FastDecimalFormat( final int type, final Locale locale, final boolean useFormattingFromResources ); }
FastDecimalFormat implements FastFormat { public String format( final Object parameters ) { if ( parameters == null ) { throw new NullPointerException(); } if ( parameters instanceof Number == false ) { throw new IllegalArgumentException( "Cannot format given Object as a Number" ); } if ( buffer == null ) { buffer = new StringBuffer(); } else { buffer.delete( 0, buffer.length() ); } if ( fieldPosition == null ) { fieldPosition = new DummyFieldPosition(); } else { fieldPosition.clear(); } final StringBuffer stringBuffer = decimalFormat.format( parameters, buffer, new DummyFieldPosition() ); return stringBuffer.toString(); } FastDecimalFormat( final String pattern );  FastDecimalFormat( final String pattern, final Locale locale );  FastDecimalFormat( final int type, final Locale locale );  FastDecimalFormat( final int type, final Locale locale, final boolean useFormattingFromResources ); Locale getLocale(); String getPattern(); String format( final Object parameters ); boolean equals( final Object o ); int hashCode(); Object clone(); }
FastDecimalFormat implements FastFormat { public String format( final Object parameters ) { if ( parameters == null ) { throw new NullPointerException(); } if ( parameters instanceof Number == false ) { throw new IllegalArgumentException( "Cannot format given Object as a Number" ); } if ( buffer == null ) { buffer = new StringBuffer(); } else { buffer.delete( 0, buffer.length() ); } if ( fieldPosition == null ) { fieldPosition = new DummyFieldPosition(); } else { fieldPosition.clear(); } final StringBuffer stringBuffer = decimalFormat.format( parameters, buffer, new DummyFieldPosition() ); return stringBuffer.toString(); } FastDecimalFormat( final String pattern );  FastDecimalFormat( final String pattern, final Locale locale );  FastDecimalFormat( final int type, final Locale locale );  FastDecimalFormat( final int type, final Locale locale, final boolean useFormattingFromResources ); Locale getLocale(); String getPattern(); String format( final Object parameters ); boolean equals( final Object o ); int hashCode(); Object clone(); static final int TYPE_DEFAULT; static final int TYPE_INTEGER; static final int TYPE_CURRENCY; static final int TYPE_PERCENT; }