i want pass string ddmathparser , store answer in string variable using swift. totally new ios platform dont know syntax of functions. example:
var expr = "5+9*2" //some expression var result = ddmathparser.evaluate(expr) // result of expression
here simple example how use ddmathparser swift:
let expr = "5+9*2" nsstring let result = expr.numberbyevaluatingstring().integervalue println(result) // 23
if need floating point results replace integervalue
doublevalue
.
Comments
Post a Comment