Metadata-Version: 2.3
Name: ratiobalance
Version: 0.1.0
Summary: give values and wanted ratios, the tool balances it for you
License: MIT
Author: Christoph J. Scherr
Author-email: software@cscherr.de
Requires-Python: >=3.9
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
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=====================================
01: 000000512.12                =>      48.95%
02: 000000522.00                =>      49.90%
03: 000000012.00                =>      1.15%
====================================Analysis====================================
total                           :       1046.12
optimizing                      :       02 (522.0 => 49.90%)
new 1%                          :       11.6
new 1% * rat(2)                 :       522.0 = 522.0
=====================================Result=====================================
01: 0000614.8000 (102.68)       =>      53.00%
02: 0000522.0000 (00.00)        =>      45.00%
03: 0000023.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.**

