nushell/docs/commands/into_int.md
JT 96a1bf5f8d
Experiment: Allow both $true/true and $false/false (#4696)
* Change true/false to keywords

* oops, clippy

* Both kinds of bools

* Add in some boolean variables

* disable py virtualenv test for now
2022-03-02 19:55:03 -05:00

805 B

title layout version
into int command 0.59.0

Convert value to integer

Signature

> into int ...rest --radix

Parameters

  • ...rest: column paths to convert to int (for table input)
  • --radix {number}: radix of integer

Examples

Convert string to integer in table

> echo [[num]; ['-5'] [4] [1.5]] | into int num

Convert string to integer

> '2' | into int

Convert decimal to integer

> 5.9 | into int

Convert decimal string to integer

> '5.9' | into int

Convert file size to integer

> 4KB | into int

Convert bool to integer

> [false, true] | into int

Convert to integer from binary

> '1101' | into int -r 2

Convert to integer from hex

> 'FF' |  into int -r 16