Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

string to decimal swift

let decimal: Decimal = 51000000000
let str = String(describing: decimal)

let savedValues = UserDefaults.standard

savedValues.set(str, forKey:"jitterClickCost")
savedValues.synchronize()

let value = savedValues.string(forKey: "jitterClickCost") ?? "0"

let result = Decimal(string: value)
 
PREVIOUS NEXT
Tagged: #string #decimal #swift
ADD COMMENT
Topic
Name
3+1 =