(num: int, precision: int = 2)
| 253 | |
| 254 | @staticmethod |
| 255 | def humanformat(num: int, precision: int = 2): |
| 256 | suffixes = ['', 'k', 'm', 'g', 't', 'p'] |
| 257 | if num > 999: |
| 258 | obje = sum( |
| 259 | [abs(num / 1000.0 ** x) >= 1 for x in range(1, len(suffixes))]) |
| 260 | return f'{num / 1000.0 ** obje:.{precision}f}{suffixes[obje]}' |
| 261 | else: |
| 262 | return num |
| 263 | |
| 264 | @staticmethod |
| 265 | def sizeOfRequest(res: Response) -> int: |
no outgoing calls
no test coverage detected