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.ONE, ROUND_CEILING, ROUND_DOWN, ROUND_FLOOR, ROUND_HALF_DOWN, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_UNNECESSARY, ROUND_UP, TEN, ZERO
Constructor and Description |
---|
PCurrency(BigDecimal val)
Creates a
PCurrency instance with the given value. |
PCurrency(double val)
Create a PCurrency instance with the given value.
|
PCurrency(String val)
Creates a
PCurrency instance with the given value. |
Modifier and Type | Method and Description |
---|---|
String |
getCurrencySymbol()
Retrieves the currency symbol used in this
CurrencyTextField . |
void |
setCurrencySymbol(String sym)
Sets the currency symbol to use.
|
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, stripTrailingZeros, subtract, subtract, toBigInteger, toBigIntegerExact, toEngineeringString, toPlainString, toString, ulp, unscaledValue, valueOf, valueOf, valueOf
byteValue, shortValue
public PCurrency(BigDecimal val)
PCurrency
instance with the given value.val
- the initial value as a BigDecimal
public PCurrency(double val)
val
- the initial value as a doublepublic PCurrency(String val)
PCurrency
instance with the given value.val
- the initial value as a String
public void setCurrencySymbol(String sym)
sym
- the new currency symbolpublic String getCurrencySymbol()
CurrencyTextField
.String
with the new currency symbol.Copyright © 2003, 2023, Oracle and/or its affiliates.