mirror of
https://github.com/nushell/nushell.git
synced 2025-03-13 06:58:47 +01:00
Use locale when formatting file sizes in certain cases
This commit is contained in:
parent
57800e500e
commit
71a70c75c1
@ -1,5 +1,6 @@
|
|||||||
use super::prelude::*;
|
use super::prelude::*;
|
||||||
use crate::{Filesize, FilesizeFormat, FilesizeUnitFormat, FormattedFilesize};
|
use crate::{Filesize, FilesizeFormat, FilesizeUnitFormat, FormattedFilesize};
|
||||||
|
use nu_utils::get_system_locale;
|
||||||
|
|
||||||
impl IntoValue for FilesizeUnitFormat {
|
impl IntoValue for FilesizeUnitFormat {
|
||||||
fn into_value(self, span: Span) -> Value {
|
fn into_value(self, span: Span) -> Value {
|
||||||
@ -26,7 +27,9 @@ impl FilesizeConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn format(&self, filesize: Filesize) -> FormattedFilesize {
|
pub fn format(&self, filesize: Filesize) -> FormattedFilesize {
|
||||||
self.as_filesize_format().format(filesize)
|
self.as_filesize_format()
|
||||||
|
.locale(get_system_locale()) // TODO: cache this somewhere or pass in as argument
|
||||||
|
.format(filesize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user