net.lessy.util.format.impl
Class FormatFloat

java.lang.Object
  extended by net.lessy.util.format.impl.FormatFloat
All Implemented Interfaces:
FormatIF
Direct Known Subclasses:
FormatCurrency

public class FormatFloat
extends Object
implements FormatIF

Implementation of a float formatter. The values are formatted with interpunctuation (thousands-separator) and with a maximum of 2 decimal digits.

Author:
hl

Constructor Summary
FormatFloat()
           
 
Method Summary
 String format(Object pValue, Locale locale, Properties pProps)
          Formats the value (impl.method)
protected  int getMaxDecimals()
          Returns the maximal number of decimal places (two)
protected  int getMinDecimals()
          Returns the minimal number of decimal places (zero)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatFloat

public FormatFloat()
Method Detail

format

public String format(Object pValue,
                     Locale locale,
                     Properties pProps)
Formats the value (impl.method)

Specified by:
format in interface FormatIF
Parameters:
pValue - Value to be formatted. This can be any type as long toString() delivers a float formattable value
locale - Locale to be used. If null then the default locale is used
pProps - Not used in this formatter.
Returns:
A Formatted float string

getMinDecimals

protected int getMinDecimals()
Returns the minimal number of decimal places (zero)


getMaxDecimals

protected int getMaxDecimals()
Returns the maximal number of decimal places (two)



Copyright © 2012. All Rights Reserved.