web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Dexterity calculate percentage

(0) ShareShare
ReportReport
Posted on by 185

I am new to dexterity and am in the process of moving all of our VBA mods to dexterity.

I am trying to calculate the percentage difference between 2 prices but am getting strange results;

in currency custprice; {0.07005}
in currency listprice; {0.3133}
out currency discount; 

discount = (listprice-custprice) / listprice * 100;

warning str(discount); { shows 77 should be 77.64124 }

It is probably something obvious?!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Alvin Evans Profile Picture
    185 on at

    Not really the answer but, I changed this so the values were retrieved by getting the field values rather than being passed through to the script and it worked.

  • Suggested answer
    Thomas Franz Profile Picture
    1,105 on at

    It's doing integer rounding. Rather than multiplying times "100", multiply times "100.00000" so that it will retain the decimal precision.

    Hope this helps.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans