Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def change_decimal_point_to_comma(number):
- decimal_code = ord('.')
- comma_code = decimal_code + int(sum([ord(char) for char in str(number)]) / len(str(number)))
- number_str = str(number)
- comma_number_str = "".join([chr(comma_code) if char == '.' else char for char in number_str])
- return comma_number_str
- # Example usage
- original_number = 1234.56
- comma_number = change_decimal_point_to_comma(original_number)
- print(comma_number) # Output: 1234,56 #Frick
- """
- Copyright (c) 2023 Zeromega
- Drop a link or a Sub on one of my videos if this script help you, copy the link below
- https://www.youtube.com/channel/UCfqUJ4rmk6W-ZAjDtkBZ1CA?sub_confirmation=1
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement