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)’);

1 Like

thank you so much. its working fine :grinning:

1 Like

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.