Jump to content

Number to Percent?


Recommended Posts

$num = 345

$pct = 80

$oldnum = $num

; Do some stuff that changes the value of $num

If $num < $oldnum*$pct/100 Then

; Do something else

EndIf

Something like that?

EDIT: added the phrase "that changes the value of $num"

Edited by Smed

601DisengageEnd Program

Link to comment
Share on other sites

nope... test value is always the same as present value. If you need to know that its changed you must preserve the old value. The test you presented will always fail.

601DisengageEnd Program

Link to comment
Share on other sites

$baseline = 100; 100%
$threshold = ($baseline * .80); set threshold at 80%
if $baseline <= $threshold Then
; your code goes here    
EndIf

<{POST_SNAPBACK}>

I was going to tell you were correct, but you deleted your last post before i could.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...