CurrencyMathContext

world.money.currency.number$package.CurrencyMathContext

Provides the Default given instance and factory methods for CurrencyMathContext.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

inline def apply[A <: CurrencyMathContext](using A): CurrencyMathContext

Creates a CurrencyMathContext from an implicit CurrencyMathContext.

Creates a CurrencyMathContext from an implicit CurrencyMathContext.

Attributes

Returns

The summoned CurrencyMathContext.

inline def apply(context: MathContext): CurrencyMathContext

Creates a CurrencyMathContext from a standard java.math.MathContext.

Creates a CurrencyMathContext from a standard java.math.MathContext.

Value parameters

context

The underlying MathContext.

Attributes

Returns

A new CurrencyMathContext instance.

inline def apply(precision: Int, mode: RoundingMode): CurrencyMathContext

Creates a CurrencyMathContext with a specified precision and RoundingMode.

Creates a CurrencyMathContext with a specified precision and RoundingMode.

Value parameters

mode

The RoundingMode to use for operations.

precision

The non-negative Int setting the number of digits to be used for an operation.

Attributes

inline def unwrap(v: CurrencyMathContext): MathContext

Unwraps a CurrencyMathContext to its underlying java.math.MathContext.

Unwraps a CurrencyMathContext to its underlying java.math.MathContext.

Attributes

Concrete fields

The default CurrencyMathContext, with a precision of 34 (following the IEEE 754 Decimal128 format) and using RoundingMode.HALF_EVEN.

The default CurrencyMathContext, with a precision of 34 (following the IEEE 754 Decimal128 format) and using RoundingMode.HALF_EVEN.

This context is implicitly provided for all arithmetic operations on CurrencyValue and provides a balance of high precision and unbiased rounding ("Banker's rounding"), making it suitable for most financial calculations.

Attributes

Givens

Extensions

Extensions

extension (context: CurrencyMathContext)
inline def mode: RoundingMode

The java.math.RoundingMode of the world.money.currency.CurrencyMathContext.

The java.math.RoundingMode of the world.money.currency.CurrencyMathContext.

Specifies how numbers should be rounded if they cannot be exactly represented with the given precision.

Attributes

inline def precision: Int

The precision of the CurrencyMathContext.

The precision of the CurrencyMathContext.

Defines the number of significant digits used in calculations.

Attributes

inline def value: MathContext

Returns this world.money.currency.CurrencyMathContext's underlying java.math.MathContext.

Returns this world.money.currency.CurrencyMathContext's underlying java.math.MathContext.

Attributes