String to float conversation and calculation

HI,
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)

@kumarkvinoth

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

1 Like

thank you so much. its working fine :grinning:

1 Like

@kumarkvinoth
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.

3 Likes

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