How to show this value to the user?

Guys, the scenario I have here is an account “Balance”, for example $1,000.00.

In the app, I need to show, throughout the day and in real time, how much this balance has varied, more or less.

This is because throughout the day the balance of that user will suffer credits and debits. I need to get the balance from the beginning of the day, then add or subtract the entries. The data I’m going to show is the percentage of profit or loss on the day’s initial balance, so that the user can analyze, together with his daily goal, whether it’s time to stop or continue operating.

My question is how do I get the frozen balance from the beginning of the day to do the calculations? Since with each release the balance will be changed and then I can’t deliver that number to the user.

The idea is to show the profit/loss percentage for the day. It is a football sports betting control app. And we know that the gambler starts each day with a target percentage to beat.

For example: “I stop betting when I manage to beat 5% or 10% of the amount I started my bankroll today.”

Got it, can you help me?

Hi there, @RonaldSilva… if I understand your post correctly, you likely have a data type where you are creating things for each credit/debit for each user, right? If that is the case, I would consider having a balance field on that data type, and with each credit/debit, I would update that field with the latest balance for each user. With that field in place, you would always know a user’s current balance, including the balance at the start of every day.

Anyway, just some food for thought there, and I hope it helps.


P.S. Got a gambling problem? Call 1-800-Gambler to get help. :wink:

1 Like