<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span></span></div><div><div>Okay, in markupexprplus.php I changed line 176 to just give back the variable $expr without doing the eval() stuff.</div><div><br></div><div>i.e. from</div><div><br></div><div>---</div><div>return $expr ? eval("return 0 + ($expr);") : '';</div><div>---</div><div><br></div><div>to</div><div><br></div><div>---</div><div>return $expr;</div><div>---</div><div><br></div><div>In my example:</div><div><br></div><div>---</div><div>:U:1</div><div>:K:0.5</div><div><br></div><div>{(add {$:U} {$:K})}:)</div><div>---</div><div><br></div><div>I now get </div><div><br></div><div>---</div><div>1)+(0,5</div><div>---</div><div><br></div><div>without producing an error. As I see it, pmwiki somehow changes the "." to a ",". That might have something to do with my (German) locale. Can I somehow modify the eval() part to get the correct value(s)?</div><div><br></div><div>Any tip would be helpful. Thanks a lot.</div><div><br></div><div>Martin</div><div><br></div><div><br>On 08 Sep, 2013,at 08:54 AM, Martin Kerz <<a href="mailto:mkerz@me.com">mkerz@me.com</a>> wrote:<br><br></div><div><blockquote type="cite"><div class="msg-quote"><div>Okay, I see. There must be something wrong with my installation then, because with the exact same code, I get a</div><div><br></div><div>Parse Error in /pmwiki/cookbook/markupexprplus.php(176) : eval()'d code on line 1</div><div><br></div><div>Do you have any idea, what might be wrong here? Unfortunately it is (Murphy's law ;-)) 1) mission and time critical and 2) the only bug left. </div><div><br></div><div>Martin</div><div><br>On 08 Sep, 2013,at 12:13 AM, Petko Yotov <<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>> wrote:<br><br></div><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch">Martin Kerz writes:<br><blockquote class="quoted-plain-text" type="cite">it seems, that it's not possible to calculate with fractions</blockquote><blockquote class="quoted-plain-text" type="cite">using MarkupExprPlus. </blockquote><br> On the page <a href="http://www.pmwiki.org/wiki/Cookbook/MarkupExprPlus" data-mce-href="http://www.pmwiki.org/wiki/Cookbook/MarkupExprPlus">http://www.pmwiki.org/wiki/Cookbook/MarkupExprPlus</a> you can see <br> that operations with decimal numbers are correct.<br> <br> {(add 0.5 4.2 5.9)} correctly prints 10.6<br> <br> Petko<br> <br><blockquote class="quoted-plain-text" type="cite">I want to do </blockquote><blockquote class="quoted-plain-text" type="cite"></blockquote><blockquote class="quoted-plain-text" type="cite">(:Sum:{(add {$:U} {$:K})}:)</blockquote><blockquote class="quoted-plain-text" type="cite"></blockquote><blockquote class="quoted-plain-text" type="cite">It works just fine with integers.</blockquote><blockquote class="quoted-plain-text" type="cite">Whenever I use a decimal fraction, like </blockquote><blockquote class="quoted-plain-text" type="cite"></blockquote><blockquote class="quoted-plain-text" type="cite">:U:0.5</blockquote><blockquote class="quoted-plain-text" type="cite"></blockquote><blockquote class="quoted-plain-text" type="cite">It produces an error.</blockquote><br> I have no error with your code. Check if you have 0 'zero' and not O 'letter <br> o'.<br> <br> Petko<br> <br> <br> _______________________________________________<br> pmwiki-users mailing list<br> <a href="mailto:pmwiki-users@pmichaud.com" data-mce-href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a><br> <a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" data-mce-href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a><br></div></div></blockquote></div><div class="_stretch">_______________________________________________<br> pmwiki-users mailing list<br> <a href="mailto:pmwiki-users@pmichaud.com" data-mce-href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a><br> <a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" data-mce-href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a><br></div></div></blockquote></div></div></body></html>