Prompting to get better simple algebra results

Hello, I’m working on implementing a relatively simple reporting task using assistants api. I ask the assistant to retrieve some data from a database and then calculate a few metrics. E.g. I ask to summarize how much money was spent on advertisement . The agent correctly retrieves the unaggregated data , correctly displays it, but when asked to produce a total it only gets it right every 4th attempt or so. When asked to outline the steps it took to arrive to that result, the agent again correctly prints out the expression it is trying to evaluate. However, the result of the expression is wrong.
Attached is an example of a chat I had with the assistant.

The correct answer is 40057.57

This problem seems to be pervasive and consistent.
Any ideas, tips or strategies how to at least alleviate this problem?
Thanks!

Welcome to the community!

Have you considered asking the model to use the python interpreter to compute the results?