Mryange commented on code in PR #53660:
URL: https://github.com/apache/doris/pull/53660#discussion_r2221961559
##########
be/src/vec/functions/function_string.h:
##########
@@ -3305,6 +3270,44 @@ struct FormatRoundDoubleImpl {
return {std::make_shared<DataTypeFloat64>(),
std::make_shared<vectorized::DataTypeInt32>()};
}
+ static std::string add_thousands_separator(const std::string&
formatted_num) {
+ // Find the position of the decimal point
+ size_t dot_pos = formatted_num.find('.');
+ if (dot_pos == std::string::npos) {
+ dot_pos = formatted_num.size();
+ }
+
+ // Handle the integer part
+ int start = (formatted_num[0] == '-') ? 1 : 0;
Review Comment:
这个formatted_num是fmt::format("{:.{}f}", value, decimal_places)的结果。
这个已经判断是一个正规的数了,变成字符串一定不为空,我加一个DCHECK吧。
--
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]