Skip to content

Commit

Permalink
put in float
Browse files Browse the repository at this point in the history
  • Loading branch information
stateofkate committed Apr 29, 2024
1 parent 1fd5ac5 commit a8e3717
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agentops/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def end_session(self,
if token_cost == 'unknown':
print('🖇 AgentOps: Could not determine cost of run.')
else:
print('🖇 AgentOps: This run cost ${}'.format('{:.2f}'.format(token_cost) if token_cost == 0 else '{:.6f}'.format(token_cost)))
print('🖇 AgentOps: This run cost ${}'.format('{:.2f}'.format(token_cost) if token_cost == 0 else '{:.6f}'.format(float(token_cost))))

This comment has been minimized.

Copy link
@areibman

areibman Apr 29, 2024

Contributor

Why are you casting to float?

Also, it's generally not advised to use floats when you're trying to convert decimals to string. It's advised to use the Decimal module which can avoid precision errors.

self._session = None
self._worker = None

Expand Down

0 comments on commit a8e3717

Please sign in to comment.