<SHORTDESC>
Project description
whratio
Calculate integer and decimal aspect ratio for dimensions.
CLI examples
$ whratio 1024 768
4 3 1.33
$ whratio -d -n6 256 196
1.306122
whratio -WH 2560 1080 | tr " " :
64:27
Python package examples
>>> from whratio import ratio
>>> ratio.as_int(1920, 1080)
(16, 9)
>>> ratio.as_float(1920, 1080)
1.77
>>> ratio.as_float(1920, 1080, ndigits=4)
1.7778
Installation
Using pip:
# pip3 install whratio
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
whratio-2.0.1.post1.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for whratio-2.0.1.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e73769600f594595da1bb6f52d0ac346bfb8bf7c8f46bf62537e6df0cd153c9c |
|
MD5 | 57ceb178aaa622d64e8b86955cc074e8 |
|
BLAKE2b-256 | 56cc3f25714869a741af4a8c3ea53dc0161abdf94b9bdcd1db7cc331c88a3ef2 |