How to make a converter?

I was working on a project, and I wanted to add a convertor. There are to boxes, one of which you can input data into. You type a number into the first box, and a number pops up in the second box (at a rate of 0.0046). If the input is not a number, or below 1, the output should give an error message. I always wanted to make my own calculators, customizable to my wants.

Set an onInput or onChange event listener,
You can restrict it in advance to numbers only.
But you can also check for isNun
Something like:

//call this function from the event handler
function checkInput (v){
  if (isNaN(v)) {
    return "Not a Number";
  }
const num = Number(v);
if(num < 1){return "smaller then 1";}
  return v;
}

And then assign the results to the second box.