@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD,PARAMETER,FIELD,LOCAL_VARIABLE})
public @interface DECIMAL
PL/I code
DCL A FIXED DECIMAL(10,5) INIT(123.456); PUT LIST(A) SKIP; when compiled is generated as@DECIMAL(precision=10,scale=5) java.math.BigDecimal a = new java.math.BigDecimal(0.0, new java.math.MathContext(10)).setScale(3, java.math.RoundingMode.DOWN);
System.out.println(String.format("%10.5f",a));
note that @DECIMAL java.math.BigDecimal a; provides a default of 10,0. when run displays as the following (b indicates blanks; zero suppression as if PIC'Z(5)9.9(3)')bbbb123.456
Modifier and Type | Optional Element and Description |
---|---|
int |
precision
Maximum (not current) precision or number of digits defined for this
variable as DECIMAL(p,q).
|
int |
scale
Maximum (not current) scale or number of digits defined to the right of the
decimal point for this variable as DECIMAL(p,q).
|