title: Why is Swift Decimal Returning Number from String Containing Letters?
body: <p>I am working with Swift's <code>Decimal</code> type, trying to ensure that an user-entered <code>String</code> is a valid <code>Decimal</code>.</p>
  
  <p>I have two <code>String</code> values, each including a letter, within my Playground file. One of the values contains a letter at the start, while the other contains a letter at the end. I initialize a <code>Decimal</code> using each value, and only one <code>Decimal</code> initialization fails; the <code>Decimal</code> initialized with the value that contains the letter at the beginning. </p>
  
  <p>Why does the <code>Decimal</code> initialized with a value that contains a letter at the end return a valid <code>Decimal</code>? I expect <code>nil</code> to be returned.</p>
  
  <p>Attached is a screenshot from my Playground file.</p>
  
  <p><a href="https://i.stack.imgur.com/wXGKh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wXGKh.png" alt="Screenshot of code that produces a valid Decimal from a String with a trailing letter"></a></p>