Klasse FinancialMath
java.lang.Object
de.delinkedde.areashopreborn.domain.FinancialMath
Provides deterministic decimal calculations shared by financial use cases.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic BigDecimalpercentageOf(BigDecimal amount, BigDecimal percent) Calculates a percentage and rounds the result to two currency decimals using banker's rounding.
-
Methodendetails
-
percentageOf
Calculates a percentage and rounds the result to two currency decimals using banker's rounding. Inputs remain unchanged and binary floating-point arithmetic is never used.- Parameter:
amount- monetary reference amountpercent- percentage expressed as a decimal number, for example7.5- Gibt zurück:
- percentage result with a scale of two
- Löst aus:
NullPointerException- when either input isnull
-