def strip_power()

in analysis/GreenSKU-Framework/src/carbon_model.py [0:0]


def strip_power(s):
    s = str(s)
    if s.endswith('kW'):
        s = float(s.replace('kW', ''))*1000
    elif s.endswith('MW'):
        s = float(s.replace('MW', ''))*1000000
    elif s.endswith('GW'):
        s = float(s.replace('GW', ''))*1000000000
    elif s.endswith('W'):
        s = float(s.replace('W', ''))
    return float(s)