JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" name="one" class="currency">

JavaScript

$('.currency').live('keydown', function(e) { 
        var key = e.keyCode || e.which; 
        
          if (key== 9 || key == 13) { 
            e.preventDefault(); 
              if( isNaN( parseFloat( this.value ) ) ) return;
                    this.value = parseFloat(this.value).toFixed(2);
            // call custom function here
          }         
       
    });