mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
add docs in docs section
This commit is contained in:
parent
1bd6eef9c2
commit
b5b200c483
@ -737,6 +737,41 @@ Result:
|
|||||||
└────────────┴───────┘
|
└────────────┴───────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## formatDecimal
|
||||||
|
|
||||||
|
Represents a numeric value as String with exact number of fractional digits.
|
||||||
|
|
||||||
|
**Syntax**
|
||||||
|
|
||||||
|
``` sql
|
||||||
|
formatDecimal(number, num_digits)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Parameters**
|
||||||
|
|
||||||
|
- `number` — Value to be represented as String, of any numeric value. [Int, UInt](/docs/en/sql-reference/data-types/int-uint.md), [Float](/docs/en/sql-reference/data-types/float.md), [Decimal](/docs/en/sql-reference/data-types/decimal.md),
|
||||||
|
- `num_digits` — Number of fractional digits [UInt8](/docs/en/sql-reference/data-types/int-uint.md).
|
||||||
|
|
||||||
|
**Returned value**
|
||||||
|
|
||||||
|
- Input value represented as [String](/docs/en/sql-reference/data-types/string.md) with given scale.
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
|
||||||
|
Query:
|
||||||
|
|
||||||
|
``` sql
|
||||||
|
SELECT formatDecimal(CAST('64.32', 'Float64'), 5);
|
||||||
|
```
|
||||||
|
|
||||||
|
Result:
|
||||||
|
|
||||||
|
```response
|
||||||
|
┌─formatDecimal(CAST('64.32', 'Float64'), 5)──┐
|
||||||
|
│ 64.32000 │
|
||||||
|
└─────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
## reinterpretAsUInt(8\|16\|32\|64)
|
## reinterpretAsUInt(8\|16\|32\|64)
|
||||||
|
|
||||||
## reinterpretAsInt(8\|16\|32\|64)
|
## reinterpretAsInt(8\|16\|32\|64)
|
||||||
|
@ -553,6 +553,41 @@ SELECT toFixedString('foo\0bar', 8) AS s, toStringCutToZero(s) AS s_cut;
|
|||||||
└────────────┴───────┘
|
└────────────┴───────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## formatDecimal
|
||||||
|
|
||||||
|
Принимает любой численный тип первым аргументом, возвращает строковое десятичное представление числа с точностью, заданной вторым аргументом.
|
||||||
|
|
||||||
|
**Синтаксис**
|
||||||
|
|
||||||
|
``` sql
|
||||||
|
formatDecimal(number, num_digits)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Параметры**
|
||||||
|
|
||||||
|
- `number` — Число любого числового типа: [Int, UInt](/docs/en/sql-reference/data-types/int-uint.md), [Float](/docs/en/sql-reference/data-types/float.md), [Decimal](/docs/en/sql-reference/data-types/decimal.md),
|
||||||
|
- `num_digits` — Требуемое количество десятичных знаков после запятой, [UInt8](/docs/en/sql-reference/data-types/int-uint.md).
|
||||||
|
|
||||||
|
**Возвращаемое значение**
|
||||||
|
|
||||||
|
- Строка ([String](/docs/en/sql-reference/data-types/string.md)), представляющая собой входное число с заданной точностью.
|
||||||
|
|
||||||
|
**Пример использования**
|
||||||
|
|
||||||
|
Запрос:
|
||||||
|
|
||||||
|
``` sql
|
||||||
|
SELECT formatDecimal(CAST('64.32', 'Float64'), 5);
|
||||||
|
```
|
||||||
|
|
||||||
|
Результат:
|
||||||
|
|
||||||
|
```response
|
||||||
|
┌─formatDecimal(CAST('64.32', 'Float64'), 5)──┐
|
||||||
|
│ 64.32000 │
|
||||||
|
└─────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
## reinterpretAsUInt(8\|16\|32\|64) {#reinterpretasuint8163264}
|
## reinterpretAsUInt(8\|16\|32\|64) {#reinterpretasuint8163264}
|
||||||
|
|
||||||
## reinterpretAsInt(8\|16\|32\|64) {#reinterpretasint8163264}
|
## reinterpretAsInt(8\|16\|32\|64) {#reinterpretasint8163264}
|
||||||
|
Loading…
Reference in New Issue
Block a user