fix compression ratio function (#561)

This commit is contained in:
jumon 2022-12-05 08:27:42 +09:00 committed by GitHub
parent eff383b27b
commit ec1b34bb90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,8 @@ def optional_float(string):
def compression_ratio(text) -> float:
return len(text) / len(zlib.compress(text.encode("utf-8")))
text_bytes = text.encode("utf-8")
return len(text_bytes) / len(zlib.compress(text_bytes))
def format_timestamp(seconds: float, always_include_hours: bool = False, decimal_marker: str = '.'):