Raised This Month: $ Target: $400
 0% 

Is This Possible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-06-2016 , 13:18   Re: Is This Possible?
Reply With Quote #1

This will do what you want:

Code:
iSomething = iSomething > 5 ? 5 : iSomething
However, it would probably be better to just use a standard if statement (on multiple lines).

If you have an upper and lower limit, you should use clamp():

Code:
iSomething = clamp(iSomething, 0, 5)
__________________

Last edited by fysiks; 12-06-2016 at 13:25.
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode