sth2sth
thutil.sth2sth
¶
Functions:
file2str(file_path: Union[str, Path]) -> str
¶
str2file(text: str, file_path: Union[str, Path]) -> None
¶
file2list(file_path: Union[str, Path]) -> list[str]
¶
list2file(text_list: list, file_path: Union[str, Path]) -> None
¶
float2str(floatnum, decimals=6)
¶
convert float number to str REF: https://stackoverflow.com/questions/2440692/formatting-floats-without-trailing-zeros
Parameters:
-
floatnum
(float
) –float number
-
fmt
(str
) –format of the output string
Returns:
-
s
(str
) –string of the float number