Skip to content

Commit

Permalink
no trailing dots in float formatting (#2353)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Jan 12, 2022
1 parent 6dd2778 commit 29f688a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions polars/polars-core/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,15 @@ fn fmt_float<T: Num + NumCast>(f: &mut Formatter<'_>, width: usize, v: T) -> fmt
s = &s[..len];
}
if s.ends_with('.') {
write!(f, "{}0...", s)
write!(f, "{}0", s)
} else {
write!(f, "{}...", s)
write!(f, "{}", s)
}
} else {
// 12.0934509341243124
// written as
// 12.09345...
write!(f, "{:>width$.6}...", v, width = width)
// 12.09345
write!(f, "{:>width$.6}", v, width = width)
}
}
} else if v.fract() == 0.0 {
Expand Down

0 comments on commit 29f688a

Please sign in to comment.