<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.tar.gz
(2.2 kB
view hashes)