Ceiling
Returns a number rounded to the next highest integer.
Syntax
ceiling (numeric_exp)
Examples
ceiling (-1.23)
Returns the result: -1
ceiling (1.23)
Returns the result: 2
Floor
Returns a number rounded to the next lowest integer.
floor (numeric_exp)
floor (-1.23)
Returns the result: -2
floor (3.45)
Returns the result: 3
Integer-Divide
Returns the integer obtained from truncating the result of an integer divided by a second integer.
integer-divide (integer_exp1, integer_exp2)
integer-divide (10, 20)
Returns the result: 0
integer-divide (20, 6)
Mod
Returns the remainder (modulus) of an integer divided by a second integer. If the second integer is zero, Transformer issues a divide by zero error.
mod (integer_exp1, integer_exp2)
Example
mod (245,3)
Number-to-String
Returns a string from a number. If the number is negative, a minus sign (-) precedes the string. If the number is a real number, only the truncated integer part of the number is converted to a string.
number-to-string (numeric_exp)
number-to-string (12345)
Returns the result: 12345
number-to-string (12345.678)
Round-Down
Returns a number rounded down.
The integer_exp value determines the position that is rounded. A positive integer_exp acts on the digits to the right of the decimal point. A negative integer_exp acts on the digits to the left of the decimal point. An integer_exp value of zero rounds the number and removes the decimal places.
round-down (numeric_exp, integer_exp)
round-down (-113.6667, 0)
Returns the result: -114
round-down (-113.6667, 1)
Returns the result: -113.7
round-down (-113.6667, -1)
Returns the result: -120
round-down (-113.6667, -2)
Returns the result: -200
round-down (366.2162, 0)
Returns the result: 366
round-down (366.2162, 1)
Returns the result: 366.2
round-down (366.2162, -1)
Returns the result: 360
round-down (366.2162, -2)
Returns the result: 300
Round-Near
Returns a number rounded to the nearest value.
The integer_exp value determines the position that is rounded. A positive integer_exp value acts on the digits to the right of the decimal point. A negative integer_exp value acts on the digits to the left of the decimal point. An integer_exp value of zero rounds the number and removes the decimal places.
round-near (numeric_exp, integer_exp)
round-near (-113.6667, 0)
round-near (-113.6667, 1)
round-near (-113.6667, -1)
Returns the result: -110
round-near (-113.6667, -2)
Returns the result: -100
round-near (366.2162, 0)
round-near (366.2162, 1)
round-near (366.2162, -1)
Returns the result: 370
round-near (366.2162, -2)
Returns the result: 400
Round-Up
Returns a number rounded up.
The An integer_exp value determines the position that is rounded. A positive An integer_exp value acts on the digits to the right of the decimal point. A negative An integer_exp value acts on the digits to the left of the decimal point. An integer_exp value of zero rounds the number and removes the decimal places.
round-up (numeric_exp, integer_exp)
round-up (-113.6667, 0)
Returns the result: -113
round-up (-113.6667, 1)
Returns the result: -113.6
round-up (-113.6667, -1)
round-up (-113.6667, -2)
round-up (366.2162, 0)
Returns the result: 367
round-up (366.2162, 1)
Returns the result: 366.3
round-up (366.2162, -1)
round-up (366.2162, -2)
Round-Zero
Returns a number rounded toward zero.
round-zero (numeric_exp, integer_exp)
round-zero (-113.6667, 0)
round-zero (-113.6667, 1)
round-zero (-113.6667, -1)
round-zero (-113.6667, -2)
round-zero (366.2162, 0)
round-zero (366.2162, 1)
round-zero (366.2162, -1)
round-zero (366.2162, -2)
Sqrt
Returns the square root of a positive number.
sqrt (numeric_exp)
sqrt (2)
Returns the result: 1.4142135623731
sqrt (64)
Returns the result: 8
如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!
关于TWT使用指南社区专家合作厂商入驻社区企业招聘投诉建议版权与免责声明联系我们 © 2024talkwithtrend — talk with trend,talk with technologist京ICP备09031017号-30
添加新评论0 条评论