Skip to content

Instantly share code, notes, and snippets.

@codeniko
Created November 22, 2017 05:51
Show Gist options
  • Select an option

  • Save codeniko/963f47b0ecc139ce0274ae2dea8f56b9 to your computer and use it in GitHub Desktop.

Select an option

Save codeniko/963f47b0ecc139ce0274ae2dea8f56b9 to your computer and use it in GitHub Desktop.
Intake calorie calculator for adult neutered cats
#!/usr/local/bin/node
// formula from: https://vet.osu.edu/vmc/companion/our-services/nutrition-support-service/basic-calorie-calculator
const args = process.argv
if (args.length !== 3) {
console.log(`./${__filename} POUNDS`)
return 1
}
const pounds = process.argv[2]
const kg = (pounds / 2.20462)
const rer = Math.pow(kg, .75) * 70
const calToMaintainWeight = rer * 1.6 // for neutered adult
console.log(`lb=${pounds} kg=${kg.toFixed(2)} RER=${rer.toFixed(2)}, RER*1.6=${calToMaintainWeight.toFixed(2)}`)
return 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment