Package com.portal.bas
Class PCurrency
java.lang.Object
java.lang.Number
java.math.BigDecimal
com.portal.bas.PCurrency
- All Implemented Interfaces:
Serializable
,Comparable<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:
-
Field Summary
Fields inherited from class java.math.BigDecimal
ONE, ROUND_CEILING, ROUND_DOWN, ROUND_FLOOR, ROUND_HALF_DOWN, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_UNNECESSARY, ROUND_UP, TEN, TWO, ZERO
-
Constructor Summary
ConstructorsConstructorDescriptionPCurrency
(double val) Create a PCurrency instance with the given value.Creates aPCurrency
instance with the given value.PCurrency
(BigDecimal val) Creates aPCurrency
instance with the given value. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the currency symbol used in thisCurrencyTextField
.void
setCurrencySymbol
(String sym) Sets the currency symbol to use.Methods inherited from class java.math.BigDecimal
abs, abs, add, add, byteValueExact, compareTo, divide, divide, divide, divide, divide, divide, divideAndRemainder, divideAndRemainder, divideToIntegralValue, divideToIntegralValue, doubleValue, equals, floatValue, hashCode, intValue, intValueExact, longValue, longValueExact, max, min, movePointLeft, movePointRight, multiply, multiply, negate, negate, plus, plus, pow, pow, precision, remainder, remainder, round, scale, scaleByPowerOfTen, setScale, setScale, setScale, shortValueExact, signum, sqrt, stripTrailingZeros, subtract, subtract, toBigInteger, toBigIntegerExact, toEngineeringString, toPlainString, toString, ulp, unscaledValue, valueOf, valueOf, valueOf
Methods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
PCurrency
Creates aPCurrency
instance with the given value.- Parameters:
val
- the initial value as aBigDecimal
-
PCurrency
public PCurrency(double val) Create a PCurrency instance with the given value.- Parameters:
val
- the initial value as a double
-
PCurrency
Creates aPCurrency
instance with the given value.- Parameters:
val
- the initial value as aString
-
-
Method Details
-
setCurrencySymbol
Sets the currency symbol to use.- Parameters:
sym
- the new currency symbol
-
getCurrencySymbol
Retrieves the currency symbol used in thisCurrencyTextField
.- Returns:
- A
String
with the new currency symbol.
-