Oracle functions for processing decimal places

Source: Internet
Author: User

Oracle functions can implement many functions. The Oracle functions described below are used to process decimal places. If you are interested in Oracle function databases, take a look.

Oracle functions for processing decimal digits ():

1. Take the rounded decimal places
Select round (1.2345, 3) from dual;
Result: 1.235

2. retain the two decimal places.
Select trunc (1.2345, 2) from dual;
Result: 1.23

Select trunc (1.2399, 2) from dual;
Result: 1.23

3. Take an integer
Returns the largest integer greater than or equal to x:
SQL> select ceil (23.33) from dual;
Result: 24

Returns the largest integer equal to or less than x:
SQL> select floor (23.33) from dual;
Result: 23

Returns the value of x rounded to the right of the decimal point, which is rcund (x, [y]).
SQL> select role (23.33) from dual;
Result: 23

Returns x rounded to y decimal places: trunc (x, [y]).
SQL> select trunc (23.33) from dual;
Result: 23

The preceding section describes the Oracle functions used to process decimal places.

Learn about Oracle Text Functions

Oracle trunc () function usage

Provides you with an in-depth understanding of Oracle triggers

Differences between Oracle procedures and functions

Use of Oracle to_char Functions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.