Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -3,13 +3,11 @@ title: cast.ToFloat
description: Converts a value to a decimal floating-point number (base 10).
categories: []
keywords: []
action:
aliases: [float]
related:
- functions/cast/ToInt
- functions/cast/ToString
returnType: float64
signatures: [cast.ToFloat INPUT]
params:
functions_and_methods:
aliases: [float]
returnType: float64
signatures: [cast.ToFloat INPUT]
aliases: [/functions/float]
---

View File

@@ -2,13 +2,11 @@
title: cast.ToInt
description: Converts a value to a decimal integer (base 10).
keywords: []
action:
aliases: [int]
related:
- functions/cast/ToFloat
- functions/cast/ToString
returnType: int
signatures: [cast.ToInt INPUT]
params:
functions_and_methods:
aliases: [int]
returnType: int
signatures: [cast.ToInt INPUT]
aliases: [/functions/int]
---
@@ -46,8 +44,7 @@ With a hexadecimal (base 16) input:
{{ int "0x11" }} → 17 (int)
```
{{% note %}}
Values with a leading zero are octal (base 8). When casting a string representation of a decimal (base 10) number, remove leading zeros:
> [!note]
> Values with a leading zero are octal (base 8). When casting a string representation of a decimal (base 10) number, remove leading zeros:
`{{ strings.TrimLeft "0" "0011" | int }} → 11`
{{% /note %}}

View File

@@ -3,13 +3,11 @@ title: cast.ToString
description: Converts a value to a string.
categories: []
keywords: []
action:
aliases: [string]
related:
- functions/cast/ToFloat
- functions/cast/ToInt
returnType: string
signatures: [cast.ToString INPUT]
params:
functions_and_methods:
aliases: [string]
returnType: string
signatures: [cast.ToString INPUT]
aliases: [/functions/string]
---

View File

@@ -1,12 +1,7 @@
---
title: Cast functions
linkTitle: cast
description: Template functions to cast a value from one data type to another.
description: Use these functions to cast a value from one data type to another.
categories: []
keywords: []
menu:
docs:
parent: functions
---
Use these functions to cast a value from one data type to another.