Placement of other punctuationWhen a parenthetical sentence stands on its own, the closing punctuation mark for the sentence is placed inside the closing parenthesis.
Example The idea that theoretical physics can be taught without reference to complex mathematics is patently absurd. (But don’t tell that to the publishers of such mathematics-free books—or the people who buy them.)
When parenthetical content occurs at the end of a larger sentence, the closing punctuation mark for the sentence is placed outside the closing parenthesis.
Example After three weeks on set, the cast was fed up with his direction (or, rather, lack of direction).
When parenthetical content occurs in the middle of a larger sentence, the surrounding punctuation should be placed outside the parentheses, exactly as it would be if the parenthetical content were not there.
Example We verified his law degree (Yale, class of 2002), but his work history remains unconfirmed.
When a complete sentence occurs in parentheses in the middle of a larger sentence, it should neither be capitalized nor end with a period—though a question mark or exclamation point is acceptable.
Example We verified his law degree (none of us thought he was lying about that) but not his billion-dollar verdict against Exxon (how gullible did he think we were?).
From
https://www.thepunctuationguide.com/parentheses.html© 2020 thepunctuationguide.com