W3cubDocs

/Nushell

fmt for conversions

Format a number.

Signature

> fmt {flags}

Input/output types:

input output
number record

Examples

Get a record containing multiple formats for the number 42

>42|fmt
╭──────────┬──────────╮
binary0b101010
debug42
display42
lowerexp4.2e1
lowerhex0x2a
octal0o52
upperexp4.2E1
upperhex0x2A
╰──────────┴──────────╯

Tips: Command fmt was not included in the official binaries by default, you have to build it with --features=extra flag

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