Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ public ScaledBigDecimal roundToScale(int scale) {
}

@Override
@NonNull
public String toString() {
return this.value().toString();
}
Expand All @@ -233,4 +234,48 @@ public int hashCode() {
public int compareTo(@NonNull ScaledBigDecimal o) {
return this.value().compareTo(o.value());
}

/**
* @deprecated Allow drop-in-replacement of ScaledBigDecimal in the original project.
* This is temporary. We need to avoid changing any rounding logic at the moment.
*/
@Deprecated
@NonNull
public BigDecimal toCurrency() {
return this.value().setScale(2, RoundingMode.HALF_UP);
}

/**
* @deprecated Allow drop-in-replacement of ScaledBigDecimal in the original project.
* This is temporary. We need to avoid changing any rounding logic at the moment.
*/
@Deprecated
@NonNull
public ScaledBigDecimal roundToCurrency() {
return new ScaledBigDecimal(this.value().setScale(2, RoundingMode.HALF_UP));
}

public int intValue() {
return this.value().intValue();
}

public long longValue() {
return this.value().longValue();
}

public float floatValue() {
return this.value().floatValue();
}

public double doubleValue() {
return this.value().doubleValue();
}

public byte byteValue() {
return (byte) intValue();
}

public short shortValue() {
return (short) intValue();
}
}