Skip to content

Commit

Permalink
Move another one
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Jun 23, 2022
1 parent d0677df commit 32be11a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arrow/src/util/decimal.rs
Expand Up @@ -80,13 +80,12 @@ pub trait BasicDecimal: PartialOrd + Ord + PartialEq + Eq {
let (sign, rest) =
value_str.split_at(if integer >= BigInt::from(0) { 0 } else { 1 });
let bound = min(self.precision(), rest.len()) + sign.len();
let value_str = &value_str[0..bound];

if self.scale() == 0 {
let value_str = &value_str[0..bound];
value_str.to_string()
} else if rest.len() > self.scale() {
// Decimal separator is in the middle of the string
let value_str = &value_str[0..bound];
let (whole, decimal) = value_str.split_at(value_str.len() - self.scale());
format!("{}.{}", whole, decimal)
} else {
Expand Down

0 comments on commit 32be11a

Please sign in to comment.