cyb70289 commented on a change in pull request #10823:
URL: https://github.com/apache/arrow/pull/10823#discussion_r678793225



##########
File path: cpp/src/arrow/util/decimal.cc
##########
@@ -528,8 +528,8 @@ Status Decimal128::FromString(const util::string_view& s, 
Decimal128* out,
   int32_t parsed_scale = 0;
   if (dec.has_exponent) {
     auto adjusted_exponent = dec.exponent;
-    auto len = static_cast<int32_t>(significant_digits);
-    parsed_scale = -adjusted_exponent + len - 1;
+    parsed_scale =
+        -adjusted_exponent + 
static_cast<int32_t>(dec.fractional_digits.size());

Review comment:
       For `12.34e-3`, old code calcs scale = 6, now it's 5. I think 5 is 
correct.
   Just curious, looks the final precision = 4 < scale = 6, is it okay?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to