mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Merge commit '35dec7c96f7ee3eb17dd444f7067f0c776fb56ae'
This commit is contained in:
@@ -1,20 +1,15 @@
|
||||
---
|
||||
title: cast.ToFloat
|
||||
linkTitle: float
|
||||
description: Casts a value to a decimal (base 10) floating point value.
|
||||
categories: [functions]
|
||||
description: Converts a value to a decimal floating-point number (base 10).
|
||||
categories: []
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: functions
|
||||
function:
|
||||
action:
|
||||
aliases: [float]
|
||||
related:
|
||||
- functions/cast/ToInt
|
||||
- functions/cast/ToString
|
||||
returnType: float64
|
||||
signatures: [cast.ToFloat INPUT]
|
||||
relatedFunctions:
|
||||
- cast.ToFloat
|
||||
- cast.ToInt
|
||||
- cast.ToString
|
||||
aliases: [/functions/float]
|
||||
---
|
||||
|
||||
|
@@ -1,20 +1,14 @@
|
||||
---
|
||||
title: cast.ToInt
|
||||
linkTitle: int
|
||||
description: Casts a value to a decimal (base 10) integer.
|
||||
categories: [functions]
|
||||
description: Converts a value to a decimal integer (base 10).
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: functions
|
||||
function:
|
||||
action:
|
||||
aliases: [int]
|
||||
related:
|
||||
- functions/cast/ToFloat
|
||||
- functions/cast/ToString
|
||||
returnType: int
|
||||
signatures: [cast.ToInt INPUT]
|
||||
relatedFunctions:
|
||||
- cast.ToFloat
|
||||
- cast.ToInt
|
||||
- cast.ToString
|
||||
signatures: [cast/ToInt INPUT]
|
||||
aliases: [/functions/int]
|
||||
---
|
||||
|
||||
@@ -55,5 +49,5 @@ With a hexadecimal (base 16) input:
|
||||
{{% 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`
|
||||
`{{ strings/TrimLeft "0" "0011" | int }} → 11`
|
||||
{{% /note %}}
|
||||
|
@@ -1,20 +1,15 @@
|
||||
---
|
||||
title: cast.ToString
|
||||
linkTitle: string
|
||||
description: Cast a value to a string.
|
||||
categories: [functions]
|
||||
description: Converts a value to a string.
|
||||
categories: []
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: functions
|
||||
function:
|
||||
action:
|
||||
aliases: [string]
|
||||
related:
|
||||
- functions/cast/ToFloat
|
||||
- functions/cast/ToInt
|
||||
returnType: string
|
||||
signatures: [cast.ToString INPUT]
|
||||
relatedFunctions:
|
||||
- cast.ToFloat
|
||||
- cast.ToInt
|
||||
- cast.ToString
|
||||
aliases: [/functions/string]
|
||||
---
|
||||
|
||||
|
12
docs/content/en/functions/cast/_index.md
Normal file
12
docs/content/en/functions/cast/_index.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Cast functions
|
||||
linkTitle: cast
|
||||
description: Template 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.
|
Reference in New Issue
Block a user