From: Sava J. <sju...@mr...> - 2007-05-09 05:35:14
|
Hi All, this is not per se eXist question, but I thought I ask regardless: - After executing xquery, I have a result the looks like: <priv_ost>5.299999999999997</priv_ost> I would like somehow to round the result to 1 or 2 decimal places, such as <priv_ost>5.3</priv_ost> I looked into xquery functions and couldn't find one that would help; I guess I could do combo substring and concat, but is that the only way? Below is the partial query that returns <priv_ost>5.29</priv_ost> , but I am just wondering IF there is a better way? Thanks, Sava ..... return <priv_ost> { concat((substring(sum($priv_bill)-sum($priv_recv),1,1)), ".",substring((sum($priv_bill)-sum($priv_recv)),3,2)) } </priv_ost> |