It is a simple tool designed to help groups split bills and expenses fairly.
Before using go install
, you need to have Go installed on your system. If you don't have Go installed, you can download and install it from Go's official website.
Once Go is installed, you can use the following command to install the Contri Calculator globally:
go install github.com/bhpcv252/contri-calculator/cmd/contri@latest
Alternatively, you can download the precompiled binary for your platform from the Releases Page. Choose the appropriate binary for your system and follow the instructions to install it.
Once installed, execute the following command to run the project:
contri
If you want to run the project directly from the source without installing it, you can run:
make run
This will:
- Build the binary.
- Run the program.
To generate a binary file without running it, you can run:
make build
The binary file will be available in the current directory as contri
.
You can check the current version of Contri by running either of the following commands:
contri --version
or:
contri -v
Upon running, you'll be prompted to enter users' information. Leave empty to finish and calculate.
- Person's name (Required)
- Amount paid: The amount already paid by the person, if any (Optional)
- Budget: How much the user can afford (Optional)
(Name Amount Budget): John 0 100
(Name Amount Budget): Jane 200
(Name Amount Budget): Dave
(Name Amount Budget): Diana 350
Contri will calculate how much each person should contribute or receive, based on the amount they've paid and their budget. For example:
John -> 100.00 (Max Affordability)
Jane -> 100.00
Dave -> 300.00
Diana -> -50.00 (To be Collected)
- Contri will attempt to divide the total expense equally among the users or based on their budgets.
- Users who paid more than their budget will have the excess to be collected from others.