title: How to get the integer part and fractional part of a number in Swift
body: <p>This is a super basic question, but, I can't seem to find an answer in Swift.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>How do I get the whole integer part and fractional part (to the left and right of the decimal point respectively) of a number in Swift 2 and Swift 3? For example, for the number 1234.56789 —</p>
  
  <p>How do I get the integer part <strong>1234</strong>.56789 ?</p>
  
  <p>How do I get the fractional part 1234.<strong>56789</strong> ?</p>