Energy-Cost-Converter is a project mainly written in Ruby, it's free.
e.g.,: £m(2009)10-15/kWh to $bn(2010)/GW