Home Explore Blog CI



nushell

commands/docs/into_float.md
7be6ee29d9a2d83838f97ecc009513446618dce2a71e81f800000003000005cf
---
title: into float
categories: |
  conversions
version: 0.104.0
conversions: |
  Convert data into floating point number.
usage: |
  Convert data into floating point number.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `into float` for [conversions](/commands/categories/conversions.md)

<div class='command-title'>Convert data into floating point number.</div>

## Signature

```> into float {flags} ...rest```

## Parameters

 -  `...rest`: For a data structure input, convert data at the given cell paths.


## Input/output types:

| input     | output      |
| --------- | ----------- |
| bool      | float       |
| float     | float       |
| int       | float       |
| list\<any\> | list\<float\> |
| record    | record      |
| string    | float       |
| table     | table       |
## Examples

Convert string to float in table
```nu
> [[num]; ['5.01']] | into float num
╭───┬──────╮
│ # │ num  │
├───┼──────┤
│ 0 │ 5.01 │
╰───┴──────╯

```

Convert string to floating point number
```nu
> '1.345' | into float
1.345
```

Coerce list of ints and floats to float
```nu
> [4 -5.9] | into float
╭───┬───────╮
│ 0 │  4.00 │
│ 1 │ -5.90 │
╰───┴───────╯

```

Convert boolean to float
```nu
> true | into float
1
```

Chunks
480bdacb (1st chunk of `commands/docs/into_float.md`)
Title: into float: Convert data into floating point number
Summary
The `into float` command in Nushell converts various data types (bool, int, string, lists, records, tables) into floating-point numbers. It can operate on single values or on data within tables and lists by specifying cell paths.