contains() ?

contains() ?

Making a calculator for practice, and I am stuck on my last function.. I have tried a bunch of things, but here is the idea. I just want to make sure that you can't put more than one decimal in a number.

This is what I'm trying - seems like a hundred different ways... can contains() even be used like this?

      screenVal = "0"
      
      $(.button).click(function() {           // MY #bDot is class="button"
            if (screenVal === "0") {
            screenVal = "";
            }
      });

      showScreen = $('screenText').text(screenVal);

$('#bDot').click(function() {
if ($("#screenText").text()(':contains(".")')) {
return;
}
else {
screenVal = screenVal + ".";
}
showScreen();
});