Let's say there is a database that persists transaction data , e.g transaction items list of sale invoices , in raw format. Something like this
Data is exposed to other backend and frontend services by an API , let's call it API-A. All the UI components need to display rounded-off data with sum in the bottom.
Simplified version of the architecture looks like this:
The question is, should API-A take care of rounding-off and summation of data ? Such as, accepting some query string parameters to support rounding-off and summation. Or should each consumer in this architecture take care of rounding and summation separately ? and why?