Round & roundup

Source: Internet
Author: User

Round

See

Returns the number rounded up by the specified number.

Syntax

Round(Number,Num_digits)

 

Number.

The number of digits specified by num_digits.

Description

    • If num_digits is greater than 0, it is rounded to the specified decimal place.
    • If num_digits is equal to 0, it is rounded to the nearest integer.
    • If num_digits is less than 0, it is rounded to the left of the decimal point.

Example

 

Formula -------------------------------------------- description (result)

Round (2.15, 1) ---------------------------- round 2.15 To a decimal place (2.2)
Round (2.149, 1) -------------------------- round 2.149 to a decimal place (2.1)
Round (-1.475, 2) -------------------------- round-1.475 to two decimal places (-1.48)
Round (21.5,-1) ----------------------------- round 21.5 to the left of the decimal point (20)

Roundup

 

See

 

Move away from the zero value and round up the number.

 

Syntax

Roundup(Number,Num_digits)

Number is any real number to be rounded up.

The number of digits after num_digits rounding.

Description

    • The roundup function is similar to the round function. The difference is that the roundup function always rounds up a number.
    • If num_digits is greater than 0, it is rounded up to the specified decimal place.

    • If num_digits is equal to 0, it is rounded up to the nearest integer.

    • If num_digits is less than 0, it is rounded up on the left of the decimal point.

Example

Formula --------------------------------------------- description (result)
Roundup (3.2, 0) ------------------------------ round up 3.2, decimal place is 0 (4)
Roundup (76.9, 0) -------------------------- round up 76.9, decimal point is 0 (77)
Roundup (3.14159, 3) ----------------------- round up 3.14159, retain three decimal places (3.142)
Roundup (-3.14159, 1) -------------------- round-3.14159 up and keep a decimal (-3.2)
Roundup (31415.92654,-2) ---------------- round up 31415.92654 to two places (31500) on the left of the decimal point)

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.