MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / with_two_decimals

Function with_two_decimals

src/formattedcode/output_csv.py:226–234  ·  view source on GitHub ↗

Return a normalized score string with two decimal values

(val)

Source from the content-addressed store, hash-verified

224
225
226def 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
237def pretty(data):

Callers 1

flatten_scanFunction · 0.70

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected