Home Explore Blog CI



nushell

commands/docs/format_number.md
1d24873582a13d1c3382ab668bd83dbe4cb38325d65f13110000000300000406
---
title: format number
categories: |
  conversions
version: 0.104.0
conversions: |
  Format a number.
usage: |
  Format a number.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `format number` for [conversions](/commands/categories/conversions.md)

<div class='command-title'>Format a number.</div>

## Signature

```> format number {flags} ```


## Input/output types:

| input  | output |
| ------ | ------ |
| number | record |
## Examples

Get a record containing multiple formats for the number 42
```nu
> 42 | format number
╭──────────┬──────────╮
│ binary   │ 0b101010 │
│ debug    │ 42       │
│ display  │ 42       │
│ lowerexp │ 4.2e1    │
│ lowerhex │ 0x2a     │
│ octal    │ 0o52     │
│ upperexp │ 4.2E1    │
│ upperhex │ 0x2A     │
╰──────────┴──────────╯
```

Chunks
a4d0e14d (1st chunk of `commands/docs/format_number.md`)
Title: format number command
Summary
The `format number` command in Nushell converts a number into various formats such as binary, debug, display, lowercase exponential, lowercase hexadecimal, octal, uppercase exponential, and uppercase hexadecimal, returning a record containing these different representations.