to.etc.domui.converter
Class MoneyDoubleTruncatedWithSign

java.lang.Object
  extended by to.etc.domui.converter.MoneyDoubleTruncatedWithSign
All Implemented Interfaces:
IConverter<java.lang.Double>, IObjectToStringConverter<java.lang.Double>, IStringToObjectConverter<java.lang.Double>

public class MoneyDoubleTruncatedWithSign
extends java.lang.Object
implements IConverter<java.lang.Double>

Converter converting to a full money representation, including currency sign, thousands separators; this removes any zero fraction so 1000.00 is rendered like E 1,000

Author:
Frits Jalvingh Created on Jul 30, 2009

Constructor Summary
MoneyDoubleTruncatedWithSign()
           
 
Method Summary
 java.lang.String convertObjectToString(java.util.Locale loc, java.lang.Double in)
           
 java.lang.Double convertStringToObject(java.util.Locale loc, java.lang.String in)
          Does a lax conversion of an amount to a double.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoneyDoubleTruncatedWithSign

public MoneyDoubleTruncatedWithSign()
Method Detail

convertObjectToString

public java.lang.String convertObjectToString(java.util.Locale loc,
                                              java.lang.Double in)
                                       throws UIException
Specified by:
convertObjectToString in interface IObjectToStringConverter<java.lang.Double>
Throws:
UIException

convertStringToObject

public java.lang.Double convertStringToObject(java.util.Locale loc,
                                              java.lang.String in)
                                       throws UIException
Does a lax conversion of an amount to a double. The input can contain anything from currency sign to thousand separators, decimal points etc.

Specified by:
convertStringToObject in interface IStringToObjectConverter<java.lang.Double>
Throws:
UIException
See Also:
IStringToObjectConverter.convertStringToObject(java.util.Locale, java.lang.String)