See if my solved topic can help.
I was making a clicker game with cash per second (same as money per second), maybe looking at its solution can help?
Also maybe this can help?