jacktengg commented on code in PR #68397:
URL: https://github.com/apache/doris/pull/68397#discussion_r4078431474
##########
be/src/exprs/function/function_string_format.h:
##########
@@ -318,11 +320,13 @@ StringRef do_format_round(FunctionContext* context,
UInt32 scale, T int_value, T
*(result_data + whole_decimal_str_len - (frac_str_len + 1)) = '.';
}
- // Convert fractional part to string with proper padding
- T remaining_frac = std::abs(static_cast<int>(frac_value));
- for (int i = 0; i <= decimal_places - 1; ++i) {
- *(result_data + whole_decimal_str_len - 1 - i) = '0' + (remaining_frac
% 10);
- remaining_frac /= 10;
+ // Pad on the right without scaling the value: decimal_places can be as
large as 1024.
+ const Int32 trailing_zeros = decimal_places - scale;
Review Comment:
DecimalV2 problem, not to fix for now.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]