Skip to content

Quantity

Quantity

Bases: DeepDataValue[Decimal, Optional[Item], Optional[Decimal], Optional[Decimal]]

Quantity.

Parameters:

  • amount (VTQuantityContent) –

    Amount.

  • unit (VTItem | None, default: None ) –

    Unit.

  • lower_bound (VTQuantityContent | None, default: None ) –

    Lower bound.

  • upper_bound (VTQuantityContent | None, default: None ) –

    Upper bound.

amount()

The amount of quantity.

get_amount()

Gets the amount of quantity.

Returns:

get_lower_bound(default=None)

Gets the lower bound of quantity.

If the lower bound is None, returns default.

Parameters:

  • default (Decimal | None, default: None ) –

    Default lower bound.

Returns:

get_unit(default=None)

Gets the unit of quantity.

If the unit is None, returns default.

Parameters:

  • default (Item | None, default: None ) –

    Default unit.

Returns:

  • Item | None

    Unit.

get_upper_bound(default=None)

Gets the upper bound of quantity.

If the upper bound is None, returns default.

Parameters:

  • default (Decimal | None, default: None ) –

    Default upper bound.

Returns:

lower_bound()

The lower bound of quantity.

unit()

The unit of quantity.

upper_bound()

The upper bound of quantity.