Last active
November 29, 2023 17:21
-
-
Save Fooftilly/e6c3e1d3871526961229e4da9ae71d1a to your computer and use it in GitHub Desktop.
Simple ratio calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Enter value for All-time upload:" | |
read upload | |
echo "Enter value for All-time download:" | |
read download | |
ratio=$(echo "scale=2; $upload/$download" | bc) | |
echo "Your torrent ratio is: $ratio" | |
# Calculate how much additional upload is required to increase the ratio by 0.01 | |
new_ratio=$(echo "$ratio + 0.01" | bc) | |
required_upload=$(echo "scale=2; ($new_ratio * $download) - $upload" | bc) | |
echo "To increase the ratio to $new_ratio, you'll need to upload around ~${required_upload}GB of data." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment