forked from extern/nushell
allow decimals/floats to be formatted with precision (#449)
* allow decimals/floats to be formatted with precision * better error message
This commit is contained in:
@ -13,6 +13,7 @@ pub struct Config {
|
||||
pub use_grid_icons: bool,
|
||||
pub footer_mode: FooterMode,
|
||||
pub animate_prompt: bool,
|
||||
pub float_precision: i64,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
@ -25,6 +26,7 @@ impl Default for Config {
|
||||
use_grid_icons: false,
|
||||
footer_mode: FooterMode::Never,
|
||||
animate_prompt: ANIMATE_PROMPT_DEFAULT,
|
||||
float_precision: 4,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -83,9 +85,12 @@ impl Value {
|
||||
}
|
||||
"animate_prompt" => {
|
||||
let val = value.as_bool()?;
|
||||
|
||||
config.animate_prompt = val;
|
||||
}
|
||||
"float_precision" => {
|
||||
let val = value.as_integer()?;
|
||||
config.float_precision = val;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user