(no subject)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

(no subject)

Ralf Hagenbuck-2
Is there a way to use Extension:ParserFunctions #expr on semantic results with type quantity.

I try to do some math with property:Betrag Angebot wich contains some money values.

Property:Betrag Angebot
 [[has type::quantity]]

 [[corresponds to::1,00 €]]

 [[corresponds to::1,00]]

sthn like

{{#expr: 1.19*
{{#show:
MYPAGE
|?Betrag Angebot=
}}
round 2}}

or

{{#expr: 1.19*
{{formatnum:
{{#show:
RO:BV-01AP001-Enseidon GmbH-1
|?Betrag Angebot=
}}
|R}}
round 2}}


results in error

Expression-Fehler: Unerwarteter Operator <

When doing this with properties of Type:Number this works.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: (no subject)

kghbln
Heiya Ralf,

I can imagine that this does not work since quantity also pipes the unit
into the stored value. I guess the easiest will be to use two
properties. One to display and one to calculate. Or you could try to
remove the unit for calculation [0]. Have not tried with type quantity
though.

Cheers Karsten

[0]
https://www.semantic-mediawiki.org/wiki/Help:Displaying_information#Display_format

Am 30.01.2017 um 14:23 schrieb Ralf Hagenbuck:

> Is there a way to use Extension:ParserFunctions #expr on semantic results with type quantity.
>
> I try to do some math with property:Betrag Angebot wich contains some money values.
>
> Property:Betrag Angebot
>   [[has type::quantity]]
>
>   [[corresponds to::1,00 €]]
>
>   [[corresponds to::1,00]]
>
> sthn like
>
> {{#expr: 1.19*
> {{#show:
> MYPAGE
> |?Betrag Angebot=
> }}
> round 2}}
>
> or
>
> {{#expr: 1.19*
> {{formatnum:
> {{#show:
> RO:BV-01AP001-Enseidon GmbH-1
> |?Betrag Angebot=
> }}
> |R}}
> round 2}}
>
>
> results in error
>
> Expression-Fehler: Unerwarteter Operator <
>
> When doing this with properties of Type:Number this works.
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Loading...