The code
eval("7/2")
yields the result 3
. I would prefer that it returned 3.5
. How can I achieve this please?
Update: I have now realised that the eval() is a 'red herring' and this is a duplicate of How can I force division to be floating point? Division keeps rounding down to 0 and probably about a hundred other questions.