Class PCurrency

All Implemented Interfaces:
Serializable, Comparable<BigDecimal>

public class PCurrency extends BigDecimal
PCurrency is essentially a BigDecimal that encapsulates a currency symbol. It is useful when you need to pass a numeric value to a component, but have that component display a currency symbol other than the locale default.
See Also:
  • Constructor Details

    • PCurrency

      public PCurrency(BigDecimal val)
      Creates a PCurrency instance with the given value.
      Parameters:
      val - the initial value as a BigDecimal
    • PCurrency

      public PCurrency(double val)
      Create a PCurrency instance with the given value.
      Parameters:
      val - the initial value as a double
    • PCurrency

      public PCurrency(String val)
      Creates a PCurrency instance with the given value.
      Parameters:
      val - the initial value as a String
  • Method Details

    • setCurrencySymbol

      public void setCurrencySymbol(String sym)
      Sets the currency symbol to use.
      Parameters:
      sym - the new currency symbol
    • getCurrencySymbol

      public String getCurrencySymbol()
      Retrieves the currency symbol used in this CurrencyTextField.
      Returns:
      A String with the new currency symbol.