Skip to content

Instantly share code, notes, and snippets.

@Fooftilly
Last active November 29, 2023 17:21
Show Gist options
  • Save Fooftilly/e6c3e1d3871526961229e4da9ae71d1a to your computer and use it in GitHub Desktop.
Save Fooftilly/e6c3e1d3871526961229e4da9ae71d1a to your computer and use it in GitHub Desktop.
Simple ratio calculator
#!/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