Metadata-Version: 2.3
Name: ratiobalance
Version: 0.2.3
Summary: give values and wanted ratios, the tool balances it for you
License: MIT
Keywords: calculator,cli,finance,ratio
Author: Christoph J. Scherr
Author-email: software@cscherr.de
Requires-Python: >=3.9
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering :: Mathematics
Description-Content-Type: text/markdown

# Ratiobalance

I needed something to balance numbers to certain percentages, but only with addition.
The math was not convenient in a calculator, so I made this program to do it for
me. It's neat with some good information, showing the differences too.

```bash
$ ratiobalance 512.12 522 12 -r 53 45 2

=====================================Values=====================================
 1: 512.12                      => 48.95%
 2: 522.00                      => 49.90%
 3: 12.00                       => 1.15%
====================================Analysis====================================
total                           :  1046.12
optimizing                      :  2 (522.0 => 49.90%)
new 1%                          :  11.6
new 1% * rat(2)                 :  522.0 = 522.0
=====================================Result=====================================
 1: 614.8000     (     +102.68) => 53.00%
 2: 522.0000     (       +0.00) => 45.00%
 3: 23.2000      (      +11.20) => 2.00%
================================Result Analysis=================================
factor for added                :  1.00
new total                       :  1160.00
total diff                      :  113.88
================================================================================
```

For cases where you don't want to keep the ratio but rather changed the added
amount, you can use the `-f` option to multiply the amount that gets actually
added by some factor. So if the total diff shows 113.88 as in the example, but
you want to remain under 100 changed, try around with the `-f` option until you
have reached a satisfactory result.

**Please note that using the `-f` option may make the ratio imperfect again and
that numbers are implicitly rounded to two comma values.**

