Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fix_area(area):
- mostprecise=0
- try:
- if area.count('e')==1:
- return float(area)
- if area.count('e')==2:
- clean=area.replace("{", "")
- clean2=clean.replace("}","")
- help=clean2.split("|")
- for a in help:
- if len(a)>mostprecise:
- mostprecise=len(a)
- for b in help:
- if len(b)==mostprecise:
- return float(b)
- except ValueError:
- return None
Advertisement
Add Comment
Please, Sign In to add comment