title: String to decimal swift
body: <p>I am using userdefaults to save a decimal value of unknown length ( I.e. 51000000000) . Userdefaults does not allow for the saving of long decimal numbers, so I resorted to turning the value into a string and saving it. Then I want to re load the number however I have been unable to find a way to convert string value into a decimal. How do I do this?</p>
  
  <p>Edit:</p>
  
  <p>Code for setting the value into userdefaults:</p>
  
  <pre><code>let savedValues = UserDefaults.standard
  savedValues.setValue(String(describing: buildingConstants.jitterClickConstantCost), forKey:"jitterClickCost")
  
  struct buildingConstants {
       static var jitterClickConstantCost = Decimal()
  }
  </code></pre>