W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2007

RE: round() with number of decimals as argument

From: Michael Kay <mhk@mhk.me.uk>
Date: Fri, 18 May 2007 11:12:34 +0100
To: "'Markus Jonsson'" <carnaby@passagen.se>, <public-qt-comments@w3.org>
Message-ID: <009701c79935$0e9b1770$6401a8c0@turtle>

> 
> Hello! Couldn't xpath function round() in future accept an 
> optional integer parameter that decides how many decimals to preserve?
> That would imply:
> round(1.187) = 1
> round(1.187, 1) = 1.2
> round(1.187, 2) = 1.19 
> 

This functionality is available (though with a slightly different rounding
algorithm) in the round-half-to-even function.

Michael Kay
http://www.saxonica.com/
Received on Friday, 18 May 2007 10:12:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:18 UTC