Quantcast

(no subject)

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

(no subject)

Ralf Hagenbuck-2
I posted some similar issue in the end of january. See: https://sourceforge.net/p/semediawiki/mailman/message/35635524/

I was happy that using the number-part of the quantity solved the problem that calculating with quantities do.

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

worked.

Now  - after updating to SMW 2.4.5 - this no longer works. I can't say if this is really assigned to the newer Version or not. Has something changed there? I suppose it has.

Now I have to {{formatnum:  |R}} the result of the #show expression like:

{{#expr: 1.19*
{{formatnum:
{{#show:
MYPAGE
|?Betrag Angebot#-n
|R
}}
round 2}}

Examples:

Property:Betrag Angebot

[[has type::quantity]]

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

[[corresponds to::1,00]]


MYPAGE contains [[Betrag Angebot::1100,01]]  or  [[Betrag Angebot::1100,01 €]]

{{#show:MYPAGE|?Betrag Angebot}}  results in 1.100,01  I miss the € here.

{{#show:MYPAGE|?Betrag Angebot#-n}}  results in 1100,01 That is different to the result in January wich was 1100.01

{{#expr: {{#show:MYPAGE|?Betrag Angebot#-n}} * 1.19 round 2}} results Expression-Fehler: Unerkanntes Satzzeichen „,“

{{formatnum:{{#show:MYPAGE|?Betrag Angebot#-n}}|R}} results 1100.01

{{#expr: {{formatnum: {{#show:MYPAGE|?Betrag Angebot#-n}} |R}}* 1.19 round 2}} results 1309.01


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
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: calculating with properties of type::quantity

Ralf Hagenbuck-2
 There is one more hint to the issue with quantities. The parameters -n and -u itself do not work in my case. I can not get the units#-u or use the precision parameter #-p




----- Original Nachricht ----
Von:     Ralf Hagenbuck <[hidden email]>
An:      [hidden email]
Datum:   13.03.2017 13:17
Betreff: [Semediawiki-user] (no subject)

> I posted some similar issue in the end of january. See:
> https://sourceforge.net/p/semediawiki/mailman/message/35635524/
>
> I was happy that using the number-part of the quantity solved the problem
> that calculating with quantities do.
>
> {{#expr: 1.19*
> {{#show:
> MYPAGE
> |?Betrag Angebot#-n
> }}
> round 2}}
>
> worked.
>
> Now  - after updating to SMW 2.4.5 - this no longer works. I can't say if
> this is really assigned to the newer Version or not. Has something changed
> there? I suppose it has.
>
> Now I have to {{formatnum:  |R}} the result of the #show expression like:
>
> {{#expr: 1.19*
> {{formatnum:
> {{#show:
> MYPAGE
> |?Betrag Angebot#-n
> |R
> }}
> round 2}}
>
> Examples:
>
> Property:Betrag Angebot
>
> [[has type::quantity]]
>
> [[corresponds to::1,00 €]]
>
> [[corresponds to::1,00]]
>
>
> MYPAGE contains [[Betrag Angebot::1100,01]]  or  [[Betrag Angebot::1100,01
> €]]
>
> {{#show:MYPAGE|?Betrag Angebot}}  results in 1.100,01  I miss the € here.
>
> {{#show:MYPAGE|?Betrag Angebot#-n}}  results in 1100,01 That is different to
> the result in January wich was 1100.01
>
> {{#expr: {{#show:MYPAGE|?Betrag Angebot#-n}} * 1.19 round 2}} results
> Expression-Fehler: Unerkanntes Satzzeichen „,“
>
> {{formatnum:{{#show:MYPAGE|?Betrag Angebot#-n}}|R}} results 1100.01
>
> {{#expr: {{formatnum: {{#show:MYPAGE|?Betrag Angebot#-n}} |R}}* 1.19 round
> 2}} results 1309.01
>
>
> ----------------------------------------------------------------------------
> --
> Announcing the Oxford Dictionaries API! The API offers world-renowned
> dictionary content that is easy and intuitive to access. Sign up for an
> account today to start using our lexical data to power your apps and
> projects. Get started today and enter our developer competition.
> http://sdm.link/oxford
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
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: calculating with properties of type::quantity

kghbln
Heiya Ralf,

so I guess you upgraded from 2.3.x. Hmm, the only change I remember that
relates to the "Corresponds to" special property was the positional
units enhancement [0]. Perhaps this is connected to the behaviour
change. Since this number formatting is always a bit tricky you could
perhaps fiddle on sandbox [1] which also offers French complications out
of the box. If there is an issue we could find out this way.

Cheers Karsten

[0]
https://www.semantic-mediawiki.org/wiki/Help:Special_property_Corresponds_to
[1] https://sandbox.semantic-mediawiki.org/wiki/Main_Page

Am 13.03.2017 um 14:54 schrieb Ralf Hagenbuck:

>   There is one more hint to the issue with quantities. The parameters -n and -u itself do not work in my case. I can not get the units#-u or use the precision parameter #-p
>
>
>
>
> ----- Original Nachricht ----
> Von:     Ralf Hagenbuck <[hidden email]>
> An:      [hidden email]
> Datum:   13.03.2017 13:17
> Betreff: [Semediawiki-user] (no subject)
>
>> I posted some similar issue in the end of january. See:
>> https://sourceforge.net/p/semediawiki/mailman/message/35635524/
>>
>> I was happy that using the number-part of the quantity solved the problem
>> that calculating with quantities do.
>>
>> {{#expr: 1.19*
>> {{#show:
>> MYPAGE
>> |?Betrag Angebot#-n
>> }}
>> round 2}}
>>
>> worked.
>>
>> Now  - after updating to SMW 2.4.5 - this no longer works. I can't say if
>> this is really assigned to the newer Version or not. Has something changed
>> there? I suppose it has.
>>
>> Now I have to {{formatnum:  |R}} the result of the #show expression like:
>>
>> {{#expr: 1.19*
>> {{formatnum:
>> {{#show:
>> MYPAGE
>> |?Betrag Angebot#-n
>> |R
>> }}
>> round 2}}
>>
>> Examples:
>>
>> Property:Betrag Angebot
>>
>> [[has type::quantity]]
>>
>> [[corresponds to::1,00 €]]
>>
>> [[corresponds to::1,00]]
>>
>>
>> MYPAGE contains [[Betrag Angebot::1100,01]]  or  [[Betrag Angebot::1100,01
>> €]]
>>
>> {{#show:MYPAGE|?Betrag Angebot}}  results in 1.100,01  I miss the € here.
>>
>> {{#show:MYPAGE|?Betrag Angebot#-n}}  results in 1100,01 That is different to
>> the result in January wich was 1100.01
>>
>> {{#expr: {{#show:MYPAGE|?Betrag Angebot#-n}} * 1.19 round 2}} results
>> Expression-Fehler: Unerkanntes Satzzeichen „,“
>>
>> {{formatnum:{{#show:MYPAGE|?Betrag Angebot#-n}}|R}} results 1100.01
>>
>> {{#expr: {{formatnum: {{#show:MYPAGE|?Betrag Angebot#-n}} |R}}* 1.19 round
>> 2}} results 1309.01
>>
>>
>> ----------------------------------------------------------------------------
>> --
>> Announcing the Oxford Dictionaries API! The API offers world-renowned
>> dictionary content that is easy and intuitive to access. Sign up for an
>> account today to start using our lexical data to power your apps and
>> projects. Get started today and enter our developer competition.
>> http://sdm.link/oxford
>> _______________________________________________
>> Semediawiki-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>
> ------------------------------------------------------------------------------
> Announcing the Oxford Dictionaries API! The API offers world-renowned
> dictionary content that is easy and intuitive to access. Sign up for an
> account today to start using our lexical data to power your apps and
> projects. Get started today and enter our developer competition.
> http://sdm.link/oxford
> _______________________________________________
> 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...