BigDecimal.valueOf

Translates a {@code long} value into a {@code BigDecimal} with a scale of zero.

@apiNote This static factory method is provided in preference to a ({@code long}) constructor because it allows for reuse of frequently used {@code BigDecimal} values.

@param val value of the {@code BigDecimal}. @return a {@code BigDecimal} whose value is {@code val}.

  1. BigDecimal valueOf(long unscaledVal, int scale)
  2. BigDecimal valueOf(long val)
    class BigDecimal
    static
    valueOf
    (
    long val
    )

Meta