Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

fix list formatting #762

Merged
merged 1 commit into from
Jan 16, 2022
Merged

fix list formatting #762

merged 1 commit into from
Jan 16, 2022

Conversation

fdncred
Copy link
Contributor

@fdncred fdncred commented Jan 16, 2022

Types like floats weren't getting formatted properly in lists. It should've been respecting the float_precision: x in the config.nu file.

Example: broken

> seq 1.0 0.1 2.0 
╭────┬────────────────────╮
│  0 │ 1                  │
│  1 │ 1.1                │
│  2 │ 1.2                │
│  3 │ 1.3                │
│  4 │ 1.4                │
│  5 │ 1.5                │
│  6 │ 1.6                │
│  7 │ 1.7000000000000002 │
│  8 │ 1.8                │
│  9 │ 1.9                │
│ 10 │ 2                  │
╰────┴────────────────────╯

Example: fixed, where float_precision: 2 is set in config.nu

> seq 1.0 0.1 2.0 
╭────┬──────╮
│  0 │ 1.00 │
│  1 │ 1.10 │
│  2 │ 1.20 │
│  3 │ 1.30 │
│  4 │ 1.40 │
│  5 │ 1.50 │
│  6 │ 1.60 │
│  7 │ 1.70 │
│  8 │ 1.80 │
│  9 │ 1.90 │
│ 10 │ 2.00 │
╰────┴──────╯

@fdncred fdncred merged commit c55b6c5 into nushell:main Jan 16, 2022
@fdncred fdncred deleted the fix_list_formatting branch January 16, 2022 22:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant