com.pow2.util
Class NumberUtil

java.lang.Object
  extended bycom.pow2.util.NumberUtil

public class NumberUtil
extends Object

NumberUtil class.
Really simple numer / currency utility class. To do a better job, I should include a real Currency class. However, coders are lazy...

Author:
Luca Fossato

Constructor Summary
NumberUtil()
           
 
Method Summary
static float euroCurrencyToFloat(String value)
          Get the float value from an Euro currency string representation.
static String getCurrency(Object value, String pattern)
          Get the string representation of a currency value.
static String getEuroCurrency(Object value)
          Get the string representation of the Euro currency value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberUtil

public NumberUtil()
Method Detail

euroCurrencyToFloat

public static float euroCurrencyToFloat(String value)
                                 throws ParseException
Get the float value from an Euro currency string representation.
Note: this method uses the current Locale settings.

Parameters:
value - the Euro currency string representation
Returns:
the float value from an Euro currency string representation
Throws:
ParseException - if any error occurs

getEuroCurrency

public static String getEuroCurrency(Object value)
Get the string representation of the Euro currency value.

Parameters:
value - the Object representing the value to parse
Returns:
the string representation of the Euro currency value, or null if the conversion fails

getCurrency

public static String getCurrency(Object value,
                                 String pattern)
Get the string representation of a currency value.

Parameters:
value - the Object representing the value to parse
pattern - the string pattern to use to parse the input value object
Returns:
the string representation of a currency value, or null if the conversion fails


Copyright © 2002-2004 Power Of Two S.R.L. All Rights Reserved.