Calculate integer and decimal aspect ratio for dimensions.
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.post2.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for whratio-2.0.1.post2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e41f9b2acb9b00a036b4f0e48bfeb2c97e42b708233a390de6096b63b3bbc045 |
|
MD5 | 57d040a7edffb924dcffcf9f26ca21a6 |
|
BLAKE2b-256 | 951c655af31a70b3dba26a3b0dedaba44aaa91fc558a62ece16ef458e448e879 |