quickfix.field.converter
Class DecimalConverter

java.lang.Object
  extended by quickfix.field.converter.DecimalConverter

public class DecimalConverter
extends java.lang.Object


Constructor Summary
DecimalConverter()
           
 
Method Summary
static java.lang.String convert(java.math.BigDecimal d)
          Converts a double to a string with no padding.
static java.lang.String convert(java.math.BigDecimal d, int padding)
          Converts a decimal to a string with padding.
static java.math.BigDecimal convert(java.lang.String value)
          Convert a String value to a decimal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecimalConverter

public DecimalConverter()
Method Detail

convert

public static java.lang.String convert(java.math.BigDecimal d)
Converts a double to a string with no padding.

Parameters:
d - the BigDecimal to convert
Returns:
the formatted String representing the incoming decimal.
See Also:
convert(BigDecimal, int)

convert

public static java.lang.String convert(java.math.BigDecimal d,
                                       int padding)
Converts a decimal to a string with padding.

Parameters:
d - the decimal to convert
padding - the number of zeros to add to end of the formatted decimal
Returns:
the formatted String representing the decimal.

convert

public static java.math.BigDecimal convert(java.lang.String value)
                                    throws FieldConvertError
Convert a String value to a decimal.

Parameters:
value - the String value to convert
Returns:
the parsed BigDecimal
Throws:
FieldConvertError - if the String is not a valid decimal pattern.