views:

23

answers:

0

Google Calculator formats math expressions this way:

2+2/2 ---> 2 + (2 / 2)
2+2/2*PI ---> 2 + ((2 / 2) * PI)

In others words - it adds brackets. Is there any similar PHP or JavaScript solutions to do the same thing?