title: Check if the last char is dot (.)
body: <p>I need to check if the last character of an input (<code>type=&quot;number&quot;</code>) value is a dot!</p>
  <p>Tried these, but it doesn't work:</p>
  <pre><code>let amount = $(&quot;#amount&quot;).val();
  let last_char = amount.slice(-1);
  if(last_char == &quot;.&quot;)
  {
      return;
  }
  </code></pre>
  <p>Also tried <code>amount[amount.length-1]</code> and <code>charAt()</code></p>
  <p>P.S. Input type is <code>type=&quot;number&quot;</code></p>
  <h1>Edit:</h1>
  <p>None of the answers work: <a href="https://jsfiddle.net/dne37hao/" rel="nofollow noreferrer">https://jsfiddle.net/dne37hao/</a></p>