zhiqiang-hhhh commented on code in PR #31883:
URL: https://github.com/apache/doris/pull/31883#discussion_r1595549046


##########
be/src/vec/functions/function_string.h:
##########
@@ -3017,9 +3024,11 @@ struct MoneyFormatDoubleImpl {
     static void execute(FunctionContext* context, ColumnString* result_column,
                         const ColumnPtr col_ptr, size_t input_rows_count) {
         const auto* data_column = assert_cast<const 
ColumnVector<Float64>*>(col_ptr.get());
+        // when scale is above 38, we will go here
         for (size_t i = 0; i < input_rows_count; i++) {
+            // truncate to 2 decimal places, keep same with mysql
             double value =
-                    
MathFunctions::my_double_round(data_column->get_element(i), 2, false, false);
+                    
MathFunctions::my_double_round(data_column->get_element(i), 2, false, true);

Review Comment:
   should do round instead of truncate



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to