Currently have a formula which essentially looks like this:
Math.round((20.49-14.99)*5);
The resulting number is 27.5 and AFAIK, Math.round()
should round UP if the number is 0.5 and above and round down if it is below. Unless I've misunderstood, I was assuming the result would be rounded up to 28 (as it does in Microsoft Excel, for example), but instead, it rounds down to 27.
At first I assumed it had something to do with my code, but when I console logged it, the result was exactly the same.
Am I missing something and if I have, how would I round-up from 0.5 onwards?