BIS fnc numberDigits: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "") |
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *N([a-z ])" to "$1 - n$2") |
||
(29 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=function | ||
| tkoh | | |game1= tkoh | ||
|version1= 1.00 | |||
| | |game2= arma3 | ||
|version2= 0.50 | |||
|gr1 = Arrays | |gr1= Arrays | ||
|gr2 = Strings | |gr2= Strings | ||
| Break number into array of digits. | |descr= Break number into array of digits. | ||
| number call [[BIS_fnc_numberDigits]] | |s1= number call [[BIS_fnc_numberDigits]] | ||
|p1= number: [[Number]] - | |p1= number: [[Number]] - number that should be broken down. A float will be '''truncated''', not rounded | ||
| [[Array]] of [[Number | |r1= [[Array]] of [[Number]]s - array of ''number'' digits | ||
|x1= < | |x1= <sqf>12345678 call BIS_fnc_numberDigits; // returns [1,2,3,4,5,6,7,8]</sqf> | ||
|x2= < | |x2= <sqf>123.9999 call BIS_fnc_numberDigits; // returns [1,2,3]</sqf> | ||
| [[BIS_fnc_numberText]] | |seealso= [[BIS_fnc_numberText]] [[BIS_fnc_cutDecimals]] | ||
}} | }} | ||
| | |||
< | <dl class="command_description"> | ||
< | <dt></dt> | ||
< | <dd class="notedate">Posted on 2018-03-20 - 21:25 (UTC)</dd> | ||
<dd class="notedate">Posted on | <dt class="note">[[User:vabene1111|vabene1111]]</dt> | ||
<dt class="note">[[User:vabene1111|vabene1111]] | |||
<dd class="note"> | <dd class="note"> | ||
Use this function with caution: Numbers with more than 8 digits will return wrong results | Use this function with caution: Numbers with more than 8 digits will return wrong results | ||
< | <sqf>[11111111] call BIS_fnc_numberDigits; // returns [1,1,1,1,1,1,1,1] | ||
[111111111] | [111111111] call BIS_fnc_numberDigits; // returns [1,1,1,1,1,1,1,1,2] | ||
[1111111111111] | [1111111111111] call BIS_fnc_numberDigits; // returns [1,1,1,1,1,1,1,1,0,6,5,6,0]</sqf> | ||
</dl> | </dl> | ||
Latest revision as of 15:39, 8 November 2023
Description
Syntax
- Syntax:
- number call BIS_fnc_numberDigits
- Parameters:
- number: Number - number that should be broken down. A float will be truncated, not rounded
- Return Value:
- Array of Numbers - array of number digits
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- BIS_fnc_numberText BIS_fnc_cutDecimals
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
|
- Posted on 2018-03-20 - 21:25 (UTC)
- vabene1111
- Use this function with caution: Numbers with more than 8 digits will return wrong results