You're confusing the documentation with the reality.

You also obviously don't understand the difference between the formatting of data and the actual datatype of the result.

Please go and actually test some other databases to see how they ACTUALLY behave.

On 2012-07-05 16:31, Vinod wrote:
I checked out a few databases and the behavior while rounding using 0 was to remove the decimal part:
Oracle: http://www.techonthenet.com/oracle/functions/round_nbr.php
PostgreSql: http://www.postgresql.org/docs/8.1/static/functions-math.html
Derby: does not have round function.

Even http://www.w3schools.com/sql/sql_func_round.asp shows rounding using 0 as removing the decimal part.

Are there some databases out there where rounding using 0 expect a decimal part of '.0' ?


On Thursday, July 5, 2012 1:49:35 AM UTC-4, Thomas Mueller wrote:

    Hi,

    Maybe what you are looking for is CAST:

    CAST(10.6 AS BIGINT) or CAST(ROUND(10.6, 0) AS BIGINT)

    Regards,
    Thomas


    On Thu, Jul 5, 2012 at 7:44 AM, Thomas Mueller
    <[email protected]
    <mailto:[email protected]>> wrote:
    > Hi,
    >
    > ROUND isn't about formatting, it's really only about the
    mathematical
    > rounding part.
    >
    > Regards,
    > Thomas
    >
    >
    > On Fri, Jun 29, 2012 at 8:40 PM, Vinod <[email protected]
    <mailto:[email protected]>> wrote:
    >> I am facing a round function related issues while rounding to 0
    decimal
    >> places:
    >>
    >> SELECT ROUND(10.128) FROM DUAL
    >> OutputExpected: 10, OutputActual: 10.0
    >>
    >> I also tried SELECT ROUND(10.128, 0) FROM DUAL, but that also
    gives same
    >> result.
    >>
    >> Also a multiplication which involves a double, but results into
    int value,
    >> gives a double output.
    >> select 100 * 0.1 from dual
    >> gives output as 10.0 instead of 10.
    >>
    >> Is this the desired behavior ?
    >>
    >> --
    >> You received this message because you are subscribed to the
    Google Groups
    >> "H2 Database" group.
    >> To view this discussion on the web visit
    >> https://groups.google.com/d/msg/h2-database/-/jN85uY5KgWgJ
    <https://groups.google.com/d/msg/h2-database/-/jN85uY5KgWgJ>.
    >> To post to this group, send email to
    [email protected] <mailto:[email protected]>.
    >> To unsubscribe from this group, send email to
    >> [email protected]
    <mailto:h2-database%[email protected]>.
    >> For more options, visit this group at
    >> http://groups.google.com/group/h2-database?hl=en
    <http://groups.google.com/group/h2-database?hl=en>.

--
You received this message because you are subscribed to the Google Groups "H2 Database" group. To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/7pU2_4iXrx4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.


--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to