Assuming your fields are named war1
, war2
, war3
, use:
sum(($war1, $war2, $war3)[string() castable as xs:decimal], 0.0)
And for some background on this, see the blog post Formulas for summing values, done right, which is exactly about this topic. (The very fact that there is a blog entry about this tells you that this is rather subtle, which makes your question all the more justifiable.)