Skip to content

Adding Cost/Currency/Price #39

@MadsKirkFoged

Description

@MadsKirkFoged

Creating a Issue based in @mschmitz2's excellent suggestion in #19 to add cost.
It has been on my list for some time now so lets give it a go!

I have added following (still subject to change..)

Cost f1 = new Cost(10, CostUnit.USDollar); //10 $
Energy e1 = new Energy(10, EnergyUnit.KilowattHour); //10 kWh

EnergyCost test = f1 / e1; //1 $/kWh

Any other name we should consider for the unit representing $£€?
Price Cost Currency

Name when combining it with other units:
EnergyCost CostOfEnergy EnergySpecificCost EnergyPrice

What do you guys think?

Also, we need to figure out how to convert between the different Currencies.

  • Have a hardcoded conversion that will (automatic) be updated with each build.
  • Have a way you can override the hardcoded conversions with your own
  • an option to Connect to a public Currency exchange API that will give you the current currencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions