Jump to content

This topic is 7485 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

It's late and I still need to do a lot of dev work..... and my brain starts leaving me... who can relay to that sometimes.... crazy.gif

I can't figure out this calculation.... I have two global number fields, say _gnr1 = 3500 and _gnr2 = 3450. Now I need to know how much percentage _gnr2 is from _gnr1.

I use this in a progress function, so I loop the _gnr2 down to 1. This means that I need to start with 1% and end with 100%.

Who can help me out? confused.gif

Posted

OK, gotcha.

Int((_gnr1 - _gnr2) / _gnr1 * 100)

or

100 - Int(_gnr2 / _gnr1 * 100)

Either will do... smile.gif

This topic is 7485 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.