You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2019/06/12 15:31:39 UTC

[GitHub] [nifi] matthew-formosa-gig commented on a change in pull request #3343: Nifi 5572

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:
users@infra.apache.org


With regards,
Apache Git Services