-
-
Save danieltroger/71936723389c777bd2598234c29b14af to your computer and use it in GitHub Desktop.
% charge of a battery where 12 is 0% and 16.8 is 100%
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
#!/usr/bin/env php | |
<?php | |
$x = (float) $argv[1]; | |
echo round(($x-12)/(4.8/100),2) . "%" . PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment