W3cubDocs

/Nushell

into string for conversions

Convert value to string.

Signature

> into string {flags} ...rest

Flags

  • --decimals, -d {int}: decimal digits to which to round

Parameters

  • ...rest: for a data structure input, convert data at the given cell paths

Input/output types:

input output
binary string
bool string
datetime string
duration string
filesize string
int string
list<any> list<string>
number string
record record
string string
table table

Examples

convert integer to string and append three decimal places

>5|into string-d3
5.000

convert float to string and round to nearest integer

>1.7|into string-d0
2

convert float to string

>1.7|into string-d1
1.7

convert float to string and limit to 2 decimals

>1.734|into string-d2
1.73

try to convert float to string and provide negative decimal points

>1.734|into string-d-2

convert float to string

>4.3|into string
4.3

convert string to string

>'1234'|into string
1234

convert boolean to string

>true|into string
true

convert date to string

>'2020-10-10 10:00:00 +02:00'|into datetime|into string
SatOct1010:00:002020

convert filepath to string

>lsCargo.toml|getname|into string

convert filesize to string

>1KiB|into string
1,024B

convert duration to string

>9day|into string
1wk2day

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/into_string.html