Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

What about currency precision in a plugin?

(0) ShareShare
ReportReport
Posted on by

If I sell something @4.85 w/50% discount I get extended amount 2.43 and manual discount of 2.43 -- both of them round up from 2.425.  $ precision is set to 2 and all these fields are set to currency precision (also tested them hard coded to 2 with no difference in execution.)  So, I changed my code to this betting on the rounding to take place upon conversion from decimal to Money

        //2021-12-30 make sure rounding to 2 places doesn't cause base amount <> extended amouunt   manual discount amount
                decimal manualdiscountamount = line.GetAttributeValue("baseamount").Value - line.GetAttributeValue("extendedamount").Value;
                addOrSet("manualdiscountamount", new Money(manualdiscountamount), line);

It doesn't.  Why?  What should I do, actually pull the currency precision and do all the rounding manually?  Rounding to currency precision doesn't really happen -- it's presentation level only?  Or it only happens on Update?

TIA

  • Manoj Mane Profile Picture
    1,020 on at
    RE: What about currency precision in a plugin?

    Hi,

    Please refer the below link:- 

    https://crmtipoftheday.com/1019/understand-decimal-precision-in-dynamics-365/

    Thanks,
    Manoj.

    Please mark this as VERIFIED if it helps.

  • Community Member Profile Picture
    on at
    RE: What about currency precision in a plugin?

    docs.microsoft.com/.../decimal-precision-currency-pricing says this manages rounding.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Eugen Podkorytov Profile Picture

Eugen Podkorytov 106

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

Overall leaderboard

Product updates

Dynamics 365 release plans