From: Daniel S. <st...@fu...> - 2010-06-24 20:58:41
|
Sorry, if I've confused somebody. Of course ask query (format=sum) still works with new record format! But it needs the index parameter of the field to sum. {{#ask:[[{{PAGENAME}}]] |?Projektbeitrag | +index=1 | format=sum}} I think, my sight was unclear because of the way I'm using and displaying the result and some caching issues. While searching for a solution, I've found that the handling of results has changed in SRF_Math.php of SRF 1.5.0. The query returns now a formatted number (depending on language) not a plain one as in 1.4.6. "return $this->getResultText($results, SMW_OUTPUT_HTML);" Changed to "return $wgLang->formatNum($this->getResultText($results, SMW_OUTPUT_HTML));" So my query "{{#ask:[[{{PAGENAME}}]] |? Projektbeitrag| +index=1| format=sum}}" returns now "10.000.000" instead of "10000000" for example. The calculation afterwards fails because it seems, parser function "#expr:" takes first dot as decimal delimiter, which means it reads the number as "10.000" (ten) instead of 10 million. When reverting the code line in SRF_Math.php v1.5.0, it also returns "10000000". Unfortunatelly, I didn't find a way to use plain format in the query like described in the documentation. It seems, these doesn't work for properties of type record. All these queries didn't output plain format number! {{#ask:[[{{PAGENAME}}]] |? Projektbeitrag# -| +index=1| format=sum}} {{#ask:[[{{PAGENAME}}]] |? Projektbeitrag # | +index=1| format=sum}} {{#ask:[[{{PAGENAME}}]] |? Projektbeitrag# -| +index=1}} {{#ask:[[{{PAGENAME}}]] |? Projektbeitrag # | +index=1}} I'm not aware of the reason for that code change and what other impacts it could have reverting it. For me, it seems to be a bug as long as there is no plain output format. Could anybody please give me some advice? Thanks Daniel |