Klasse FinancialMath

java.lang.Object
de.delinkedde.areashopreborn.domain.FinancialMath

public final class FinancialMath extends Object
Provides deterministic decimal calculations shared by financial use cases.
  • Methodendetails

    • percentageOf

      public static BigDecimal percentageOf(BigDecimal amount, BigDecimal percent)
      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 amount
      percent - percentage expressed as a decimal number, for example 7.5
      Gibt zurück:
      percentage result with a scale of two
      Löst aus:
      NullPointerException - when either input is null