String to float conversation and calculation


I want calculate the numbers inside the string value . how to convert float and calculate the values.
my string is : 53/(155/100)/(155/100)



ex: eval(‘53/(155/100)/(155/100)’);


thank you so much. its working fine :grinning:


glad to help please mark it as a solution…


If this string is coming from the user, eval can be very dangerous. I would strongly advise against using eval, at least until after sanitizing the string, removing anything that is not a number or a calculation symbol.


agreed @kumarkvinoth u can break this string using regex than evaluate.