ADF and ROUND()?

Mike Kiser 1,531 Reputation points
2021-09-09T15:31:30.453+00:00

Hello! @Nasreen Akter

Anyone know how to Round to 2 decimal places in an ADF Pipeline?

Thanks!
Mike

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,643 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Nandan Hegde 29,896 Reputation points MVP
    2021-09-09T16:14:48.663+00:00

  2. ShaikMaheer-MSFT 37,971 Reputation points Microsoft Employee
    2021-09-10T09:34:41.303+00:00

    Hi @Mike Kiser ,

    Thank you for posting query in Microsoft Q&A Platform.

    In ADF Pipeline round() function is not available. Hence we need to go with below explained work around to achieve same.

    Implementation:
    If you want to round 123.43467 to two decimal places, you need to multiple 123.43467 with 100(123.43467 *100 = 12343.67), then take only left side part(12343) from 12343.67. And then divide the result (12343) by 100 to get 123.43

    Please check below image which has similar logic in expression and got result.
    expression used: @string(div(float(split(string(mul(123.43467,100)),'.')[0]),100))

    131007-expression.gif

    If you would like to do round in mapping data flows then round() function is available there.

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators