mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
Fix hard-coded decimal separator in builtin math
This commit is contained in:
parent
c0028a0ec9
commit
80c02400eb
1 changed files with 2 additions and 1 deletions
|
@ -191,7 +191,8 @@ fn format_double(mut v: f64, opts: &Options) -> WString {
|
|||
if ret.chars().any(|c| !c.is_ascii_digit()) {
|
||||
let trailing_zeroes = ret.chars().rev().take_while(|&c| c == '0').count();
|
||||
let mut to_keep = ret.len() - trailing_zeroes;
|
||||
if ret.as_char_slice()[to_keep - 1] == '.' {
|
||||
// Check for the decimal separator (we don't know what character it is)
|
||||
if !ret.as_char_slice()[to_keep - 1].is_ascii_digit() {
|
||||
to_keep -= 1;
|
||||
}
|
||||
ret.truncate(to_keep);
|
||||
|
|
Loading…
Reference in a new issue