Skip to content

Commit

Permalink
updates the dataframe string formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
samgdotson committed Jun 30, 2023
1 parent bba6012 commit e4b878a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osier/technology.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,13 +562,13 @@ def to_dataframe(self, cast_to_string=True):
elif isinstance(value, unyt_quantity):
col = f"{key.strip('_')} ({value.units})"
if cast_to_string:
tech_data[col] = ["{:.3e}".format(value.to_value())]
tech_data[col] = ["{:.3g}".format(value.to_value())]
else:
tech_data[col] = [np.round(value.to_value(),10)]
elif isinstance(value, (int, float)):
col = key.strip('_')
if cast_to_string:
tech_data[col] = ["{:.3e}".format(value)]
tech_data[col] = ["{:.3g}".format(value)]
else:
tech_data[col] = [np.round(value,10)]
else:
Expand Down

0 comments on commit e4b878a

Please sign in to comment.