Jump to content

Topic on Extension talk:NumberFormat

205.209.247.222 (talkcontribs)

I love the idea of your extension. I am currently working on a pet project to build a complete, semantic CMDB so I need to be able to get rid of the comma in Office 2010 (just for example).

Do you know how I could use this function for inline quieries and the like? Most everything I'm doing is storing each piece of information and it's properties (software title, product key, vendor, version, etc) as one 'page' and calling queries throughout the rest of the site to aggregate all of that data together, using the semantic properties to pull exactly what we need every time.

Any help would be greatly appreciated!

Pastakhov (talkcontribs)

Hi, I'm not quite sure what the problem is.

I use this extension to clean the user input: [[MyNumberProperty::{{#number_format:{{{Value|0}}}|_|.||,}}]]

And clear the result of the query:

{{#ask: ...
|?MyNumberProperty
| mainlabel=-
| format=array
| name=myArray
}}

{{#arrayprint:myArray |<br /> |@@@@|{{#number_format:{{#explode:@@@@|<PROP>|0}}|_|.||,}} }}

There may be bugs, so it is not a real-life example.

For simplicity, I use a template Num: {{#iferror: {{#if: {{{1|}}} | {{#number_format:{{{1|0}}}|_|.||,}} | 0 }} | 0 }}

Then, {{#arrayprint:myArray |<br /> |@@@@|{{Num|{{#explode:@@@@|<PROP>|0}}}} }}

Cjg1979 (talkcontribs)

The problem is quite obviously me.  :)

In all seriousness, I'm just getting my feet wet with MediaWiki. I tried out DokuWiki but it was so limited, so I'm coming into MediaWiki with bad forms already in my head, and I've only been at it a week or two. That's why I asked how one would accomplish it, not if it could.

And thank you for the awesome example. You have given me more fodder for learning in this one message than I have seen all week. I'm loving all that SMW will do, and I'm trying to learn it as fast as I can. But it seems like I'm coming in late in the game!

I'll try your example out tomorrow and see if I can figure out the syntax.

Thanks again!

Reply to "Inlilne Queries"