com.ds.fw.types.formatter
Class FwFloatFormatter

java.lang.Object
  |
  +--com.ds.fw.types.formatter.FwFloatFormatter
Direct Known Subclasses:
FwCurrencyFormatter, FwPercentageFormatter

public class FwFloatFormatter
extends java.lang.Object


Constructor Summary
FwFloatFormatter()
          Creates new FwFloatFormatter
 
Method Summary
static java.lang.String format(double val, java.util.Locale inLocale)
          Format a double value , according to the locale
static java.lang.String format(float val, java.util.Locale inLocale)
          Format a float value, according to the locale
static double parseDouble(java.lang.String val, java.util.Locale inLocale)
          Parse a String to get his double value
static float parseFloat(java.lang.String val, java.util.Locale inLocale)
          Returns a new float initialized to the value represented by the specified String
static int parseInt(java.lang.String val, java.util.Locale inLocale)
          Returns a new int initialized to the value represented by the specified String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FwFloatFormatter

public FwFloatFormatter()
Creates new FwFloatFormatter

Method Detail

format

public static java.lang.String format(double val,
                                      java.util.Locale inLocale)
Format a double value , according to the locale

Parameters:
val - - the double value we want to format
inLocale - - the locale
Returns:
a String object containing the string representation of the double value

format

public static java.lang.String format(float val,
                                      java.util.Locale inLocale)
Format a float value, according to the locale

Parameters:
val - - the float value we want to format
inLocale - - the locale
Returns:
a String object containing the string representation of the float value

parseDouble

public static double parseDouble(java.lang.String val,
                                 java.util.Locale inLocale)
                          throws java.text.ParseException
Parse a String to get his double value

Parameters:
val - - the string to be parsed
inLocale - - the locale
Returns:
a new double initialized to the value represented by the specified String
Throws:
java.text.ParseException - -if the string does not contain a parsable double

parseFloat

public static float parseFloat(java.lang.String val,
                               java.util.Locale inLocale)
                        throws java.text.ParseException
Returns a new float initialized to the value represented by the specified String

Parameters:
val - - the string to be parsed
inLocale - - the locale
Returns:
the float value represented by the string argument.
Throws:
java.text.ParseException - - if the string does not contain a parsable float

parseInt

public static int parseInt(java.lang.String val,
                           java.util.Locale inLocale)
                    throws java.text.ParseException
Returns a new int initialized to the value represented by the specified String

Parameters:
val - - the string to be parsed
inLocale - - the locale
Returns:
the int value represented by the int argument
Throws:
java.text.ParseException - - if the string does not contain a parsable int