Skip to content

Commit

Permalink
Tweaking formatting more
Browse files Browse the repository at this point in the history
  • Loading branch information
cjtitus committed Nov 12, 2024
1 parent 087e69d commit c5cbe4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions export_to_xdi.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ def generate_format_string(data):
avg_value = np.mean(column_data)
max_value = np.max(np.abs(column_data))
if np.abs(avg_value) < 1:
formats.append("%.4e")
formats.append("%11.4e")
else:
width = len(str(int(max_value))) + 5 # Add 5 for decimal point, 3 decimals, and sign
formats.append(f"%+{width}.3f")
formats.append(f"%{width}.3f")

return " ".join(formats)

0 comments on commit c5cbe4e

Please sign in to comment.