trunc_numeric
The trunc_numeric function is used to truncate the input number to the specified number of decimal places.
Syntax
trunc_numeric(<number>[, bigint<decimal_places>])
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| number | Yes | DOUBLE, BIGINT, DECIMAL, or STRING | The data to be truncated. |
| decimal_places | No | BIGINT | The default value is 0. Truncates to the Nth decimal place. |
Return Values
Returns a value of type DOUBLE or DECIMAL.
Return rules are as follows:
- When number is of type DOUBLE or DECIMAL, the corresponding type is returned.
- When number is of type STRING or BIGINT, a DOUBLE type is returned.
- If decimal_places is not of type BIGINT, an error is returned.
- If the number value is NULL, NULL is returned.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot