Help with template state calculation - gas/propane bottle weight as a percentage

See here: Home Assistant - New Zealand - #46 by Greminn