Format number. Remove the unused comma. Replace the concatenation with relevant zeros. Remove the dot. :param number: str :return: int
(number)
| 1120 | |
| 1121 | |
| 1122 | def format_number(number): |
| 1123 | """ |
| 1124 | Format number. Remove the unused comma. Replace the concatenation with |
| 1125 | relevant zeros. Remove the dot. |
| 1126 | |
| 1127 | :param number: str |
| 1128 | |
| 1129 | :return: int |
| 1130 | """ |
| 1131 | formatted_num = number.replace(",", "") |
| 1132 | formatted_num = re.sub( |
| 1133 | r"(k)$", "00" if "." in formatted_num else "000", formatted_num |
| 1134 | ) |
| 1135 | formatted_num = re.sub( |
| 1136 | r"(m)$", "00000" if "." in formatted_num else "000000", formatted_num |
| 1137 | ) |
| 1138 | formatted_num = formatted_num.replace(".", "") |
| 1139 | return int(formatted_num) |
| 1140 | |
| 1141 | |
| 1142 | def username_url_to_username(username_url): |
no outgoing calls
no test coverage detected