BIS fnc clamp: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\{\{ *cc*\| *([^}]+) *\}\}" to "// $1") |
Lou Montana (talk | contribs) m (Text replacement - "= <code>([^<{]+)<\/code>" to "= <sqf>$1</sqf>") |
||
Line 16: | Line 16: | ||
|r1= [[Number]] - the clamped value | |r1= [[Number]] - the clamped value | ||
|x1= < | |x1= <sqf>[5, 0, 10] call BIS_fnc_clamp; // returns 5 | ||
[0, 0, 10] call BIS_fnc_clamp; // returns 0 | [0, 0, 10] call BIS_fnc_clamp; // returns 0 | ||
[10, 0, 10] call BIS_fnc_clamp; // returns 10 | [10, 0, 10] call BIS_fnc_clamp; // returns 10 | ||
Line 23: | Line 23: | ||
[5, '''10''', 3] call BIS_fnc_clamp; // returns 10 | [5, '''10''', 3] call BIS_fnc_clamp; // returns 10 | ||
</ | </sqf> | ||
|seealso= | |seealso= | ||
}} | }} |
Revision as of 17:00, 13 July 2022
Description
Syntax
- Syntax:
- [value, min, max] call BIS_fnc_clamp
- Parameters:
- value: Number - value to be clamped
- min: Number - (Optional, default 0) lower limit
- max: Number - (Optional, default 0) upper limit
- Return Value:
- Number - the clamped value
Examples
- Example 1:
Additional Information
- See also:
- See also needed
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note