Add filesize.show_unit config option (#15276)

# Description

Continuation of #15271. This PR adds the
`$env.config.filesize.show_unit` option to allow the ability to omit the
filesize unit. Useful if `$env.config.filesize.unit` is set to a fixed
unit, and you don't want the same unit repeated over and over.

# User-Facing Changes

- Adds the `$env.config.filesize.show_unit` option.
This commit is contained in:
Ian Manske
2025-03-09 15:34:55 -07:00
committed by GitHub
parent d97b2e3c60
commit 95dcb2fd6c
4 changed files with 46 additions and 2 deletions

View File

@ -381,9 +381,14 @@ $env.config.datetime_format.normal = "%m/%d/%y %I:%M:%S%p"
# Otherwise, setting this to one of the filesize units will use that particular unit when displaying all file sizes.
$env.config.filesize.unit = 'metric'
# filesize.show_unit (bool):
# Whether to show or hide the file size unit. Useful if `$env.config.filesize.unit` is set to a fixed unit,
# and you don't want that same unit repeated over and over again in which case you can set this to `false`.
$env.config.filesize.show_unit = true
# filesize.precision (int or nothing):
# The number of digits to display after the decimal point for file sizes.
# When set to `null`, all digits after the decimal point will be displayed.
# When set to `null`, all digits after the decimal point, if any, will be displayed.
$env.config.filesize.precision = 1
# ---------------------

View File

@ -29,6 +29,8 @@ pub fn get_system_locale_string() -> Option<String> {
},
#[cfg(test)]
{
// For tests, we use the same locale on all systems.
// To override this, set `LOCALE_OVERRIDE_ENV_VAR`.
|| Some(Locale::en_US_POSIX.name().to_owned())
},
)