[xwiki-users] [1.1] Velocity, summing properties
Hello, I would like to perform a sum in a velocity script. The following works well: #set ($a = 1) #set ($b = 1) #set ($c= $a + $b) $c returns 2 But if I modify with #set ($b = $categoryDoc.getObject("Blog.Categories","name",$bcategory).get("color_red")) ... the sum does not work anymore. It seems that $b is considered as a string and gets appended to $a instead of added. The property retrieved "color_red" is of type Number. Is there a way to convert it in order to perform arithmetics on it ? I looked at velocity dev guide but I'm quite confused ... Thanks, BOUSQUET Jeremie GGS Europe Solution CMO & PMO Gemalto Tel: +33 4 42 36 42 93 Avenue du Jujubier Z.I. Athélia IV BP 90 13705 LA CIOTAT CEDEX [email protected] <mailto:[email protected]> [email protected] <mailto:[email protected]> www.gemalto.com <http://www.gemalto.com> _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (1)
-
BOUSQUET Jeremie