calculator - javascript - How do I calculate an JavaScript expression called inside a string? -


i creating simple calculator in html , i've created input field. can type there sum , must calculated. only, don't know how...
example:
have string:

234-231*math.sqrt(9) 

is there way calculate sum inside string using javascript?

use eval() function. so: eval("234-231*sqrt(9)");


Comments

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -