matthew-formosa-gig commented on a change in pull request #3343: Nifi 5572
URL: https://github.com/apache/nifi/pull/3343#discussion_r292975472
 
 

 ##########
 File path: 
nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/util/DataTypeUtils.java
 ##########
 @@ -172,6 +180,8 @@ public static Object convertType(final Object value, final 
DataType dataType, fi
 
                 return convertType(value, chosenDataType, fieldName, charset);
             }
+            case DECIMAL:
+                return toDecimal(value, 
fieldName).setScale(((DecimalDataType)dataType).getScale(), 
RoundingMode.HALF_UP);
 
 Review comment:
   Why not pass the scale (and ideally precision) to the `toDecimal` method and 
set the scale and rounding mode (and check precision) within that method?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to