Return a normalized score string with two decimal values
(val)
| 224 | |
| 225 | |
| 226 | def with_two_decimals(val): |
| 227 | """ |
| 228 | Return a normalized score string with two decimal values |
| 229 | """ |
| 230 | if isinstance(val, (float, int)): |
| 231 | val = '{:.2f}'.format(val) |
| 232 | if not isinstance(val, str): |
| 233 | val = str(val) |
| 234 | return val |
| 235 | |
| 236 | |
| 237 | def pretty(data): |