MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / format_float

Function format_float

eval_code/recons/utils/messages.py:64–68  ·  view source on GitHub ↗
(num, total_width=20, decimal_places=12)

Source from the content-addressed store, hash-verified

62
63def format_matrix_str(matrix):
64 def format_float(num, total_width=20, decimal_places=12):
65 # strip all right 0s, then strip '.'
66 s = f"{num:{total_width}.{decimal_places}f}".rstrip("0").rstrip(".")
67 # add space to the left
68 return f"{s:>{total_width}}"
69 formatted = [
70 [
71 # f"{num:20.12f}".rstrip("0").rstrip(".") if "." in f"{num}" else f"{num:20}"

Callers 1

format_matrix_strFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected