Signed fixed-point numbers that keep precision during add, subtract and multiply operations. For division least significant digits are discarded (not rounded).
## Parameters {#parameters}
- P - precision. Valid range: \[ 1 : 38\]. Determines how many decimal digits number can have (including fraction).
- P - precision. Valid range: \[ 1 : 76\]. Determines how many decimal digits number can have (including fraction).
- S - scale. Valid range: \[ 0 : P \]. Determines how many decimal digits fraction can have.
Depending on P parameter value Decimal(P, S) is a synonym for:
Converts an input value to the [Int](../../sql-reference/data-types/int-uint.md) data type. This function family includes:
...
...
@@ -19,6 +19,8 @@ Converts an input value to the [Int](../../sql-reference/data-types/int-uint.md)
-`toInt16(expr)` — Results in the `Int16` data type.
-`toInt32(expr)` — Results in the `Int32` data type.
-`toInt64(expr)` — Results in the `Int64` data type.
-`toInt128(expr)` — Results in the `Int128` data type.
-`toInt256(expr)` — Results in the `Int256` data type.
**Parameters**
...
...
@@ -26,7 +28,7 @@ Converts an input value to the [Int](../../sql-reference/data-types/int-uint.md)
**Returned value**
Integer value in the `Int8`, `Int16`, `Int32`, or `Int64` data type.
Integer value in the `Int8`, `Int16`, `Int32`, `Int64`, `Int128` or `Int256` data type.
Functions use [rounding towards zero](https://en.wikipedia.org/wiki/Rounding#Rounding_towards_zero), meaning they truncate fractional digits of numbers.