That's harder than it seems. For example, if you're debating a purchase on the 10th of the month, there are a bunch of bills and other purchases you're going to make the rest of the month (groceries, eating out, etc.) so you don't really know how much is remaining that you have to spend.
I use a Google Sheet that has taken me years to iterate, which knows the current date, tells me what expenses I'm going to incur over the rest of the month, along with a column of estimated numbers I guess at (cost of groceries, eating out, etc. for the rest of the month) and then tells me what my true remaining balance is.