Python

[Python] '1.1k'를 1100으로 바꿔주는 함수

insub4067 2021. 11. 12. 00:42
def convert_to_int(x): if type(x) == float or type(x) == int: return x if "k" in x: if len(x) > 1: return float(x.replace("k", "")) * 1000 return 1000.0 return 0.0