Skip to content

Add a Decimal-backed Price Quantity-like class #62

Open
@llucax

Description

@llucax

What's needed?

The electricity trading API needs to deal with prices that are represented by a Decimal.

Proposed solution

Add a Price class to the quantities module, but Quantity is backed by a float.

Ideally we should have Price inherit from Quantity, and if that's not possible to at least have the same/similar interface.

Also price probably need to have attached a currency as unit, so we don't mix up prices in USD with prices in EUR for example, but this is much trickier because conversion rates are dynamic and should be retrieved by some API or something. So it is pretty different to normal quantities.

Use cases

Electricity trading client

Alternatives and workarounds

Add this class to the electricity trading API client.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:lowThis should be addressed only if there is nothing else on the tabletype:enhancementNew feature or enhancement visitble to users

    Type

    No type

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions