Last modified: 2012-11-09 19:04:43 UTC
The statistic magic words (https://www.mediawiki.org/wiki/Help:Magic_words#Statistics) produce numbers that cannot be used in calculations (as with {{#expr: ..}} parser function), because of the miles separators, as explained: "The number magic words are formatted in the wiki content language". I understand they are so for reason of aestetics. A different version of these functions is needed for calculation purposes, in a similar manner to what is done for "URL encoded page names".
You can use {{WORD:R}} to do this, e.g. {{NUMBEROFPAGES}} becomes {{NUMBEROFPAGES:R}}. The :R (or "raw") versions are plain numbers. (This is described on the very page you linked.) There is also the #formatnum: parser function, which can perform the same operation on any input.