ezvcard.util
Class VCardFloatFormatter

java.lang.Object
  extended by java.text.Format
      extended by java.text.NumberFormat
          extended by java.text.DecimalFormat
              extended by ezvcard.util.VCardFloatFormatter
All Implemented Interfaces:
Serializable, Cloneable

public class VCardFloatFormatter
extends DecimalFormat

Formats floating-point values for vCards. Notably, this ensures that a "." is used as decimal separator, no matter the locale.

Author:
Michael Angstadt
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.NumberFormat
NumberFormat.Field
 
Field Summary
 
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
 
Constructor Summary
VCardFloatFormatter()
          Creates a new formatter with a max of 6 decimals.
VCardFloatFormatter(int decimals)
          Creates a new formatter.
 
Method Summary
 
Methods inherited from class java.text.DecimalFormat
applyLocalizedPattern, applyPattern, clone, equals, format, format, format, formatToCharacterIterator, getCurrency, getDecimalFormatSymbols, getGroupingSize, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getMultiplier, getNegativePrefix, getNegativeSuffix, getPositivePrefix, getPositiveSuffix, getRoundingMode, hashCode, isDecimalSeparatorAlwaysShown, isParseBigDecimal, parse, setCurrency, setDecimalFormatSymbols, setDecimalSeparatorAlwaysShown, setGroupingSize, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setMultiplier, setNegativePrefix, setNegativeSuffix, setParseBigDecimal, setPositivePrefix, setPositiveSuffix, setRoundingMode, toLocalizedPattern, toPattern
 
Methods inherited from class java.text.NumberFormat
format, format, getAvailableLocales, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setGroupingUsed, setParseIntegerOnly
 
Methods inherited from class java.text.Format
format, parseObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VCardFloatFormatter

public VCardFloatFormatter()
Creates a new formatter with a max of 6 decimals.


VCardFloatFormatter

public VCardFloatFormatter(int decimals)
Creates a new formatter.

Parameters:
decimals - the max number of decimal places


Copyright © 2012-2014 Michael Angstadt. All Rights Reserved.