W3C home > Mailing lists > Public > www-ql@w3.org > April to June 2004

RE: Avg() or round() : How to limit the decimal place?

From: Michael Kay <mhk@mhk.me.uk>
Date: Sat, 26 Jun 2004 02:15:43 +0100
To: "'Houman Khorasani'" <khorasani@web.de>, <www-ql@w3.org>
Message-Id: <20040626011626.ECBCFA2E2A@frink.w3.org>

In XSLT you can use format-number()

In XPath and XQuery you can use round-half-to-even($x, 4)

Michael Kay 

> -----Original Message-----
> From: www-ql-request@w3.org [mailto:www-ql-request@w3.org] On 
> Behalf Of Houman Khorasani
> Sent: 25 June 2004 20:18
> To: www-ql@w3.org
> Subject: Avg() or round() : How to limit the decimal place?
> Importance: High
> 
> 
> Hello,
> 
> The avg() function im statement returns values like that:
> <avgDelay>48413.448275862068965517</avgDelay>
> 
> If I use round() so I would get 48413.  But how do I get 
> 48413.4483 ? How
> can I limit the decimal place to 4?
> 
> I couldn't find anything in W3 Draft.
> 
> Thanks
> Houman
> 
> 
Received on Friday, 25 June 2004 21:16:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 22 July 2006 00:10:19 GMT