BIS fnc numberDigits: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Fix description and example, and set game back to TKOH - missing See also) |
Lou Montana (talk | contribs) m (Add See also) |
||
Line 1: | Line 1: | ||
{{Function|= | {{Function|Comments= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| tkoh | | | tkoh |Game name= | ||
|1.00| | |1.00|Game version= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Break number into array of digits. |= | | Break number into array of digits. |Description= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| number call [[BIS_fnc_numberDigits]] |= | | number call [[BIS_fnc_numberDigits]] |Syntax= | ||
|p1= number: [[Number]] - Number that should be broken down. A float will be '''truncated''', not rounded | | |p1= number: [[Number]] - Number that should be broken down. A float will be '''truncated''', not rounded |Parameter 1= | ||
| [[Array]] of [[Number|Numbers]] - Array of ''number'' digits | | | [[Array]] of [[Number|Numbers]] - Array of ''number'' digits |Return value= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code>12345678 [[call]] [[BIS_fnc_numberDigits]]; {{codecomment|// returns [1,2,3,4,5,6,7,8]}}</code> | | |x1= <code>12345678 [[call]] [[BIS_fnc_numberDigits]]; {{codecomment|// returns [1,2,3,4,5,6,7,8]}}</code> |Example 1= | ||
|x2= <code>123.9999 [[call]] [[BIS_fnc_numberDigits]]; {{codecomment|// returns [1,2,3]}}</code> | | |x2= <code>123.9999 [[call]] [[BIS_fnc_numberDigits]]; {{codecomment|// returns [1,2,3]}}</code> |Example 2= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | | [[BIS_fnc_numberDigits]], [[BIS_fnc_cutDecimals]] |See also= | ||
}} | }} | ||
Line 33: | Line 33: | ||
<h3 style="display:none">Bottom Section</h3> | <h3 style="display:none">Bottom Section</h3> | ||
[[Category:Functions|{{uc:numberDigits}}]] | |||
[[Category:Function Group: Numbers|{{uc:numberDigits}}]] | [[Category:Function Group: Numbers|{{uc:numberDigits}}]] | ||
[[Category:{{Name|tkoh}}: Functions|{{uc:numberDigits}}]] | [[Category:{{Name|tkoh}}: Functions|{{uc:numberDigits}}]] | ||
[[Category:{{Name|arma3}}: Functions|{{uc:numberDigits}}]] | [[Category:{{Name|arma3}}: Functions|{{uc:numberDigits}}]] | ||
Line 40: | Line 40: | ||
<!-- CONTINUE Notes --> | <!-- CONTINUE Notes --> | ||
<dl class="command_description"> | <dl class="command_description"> | ||
<dd class="notedate">Posted on March 20, 2018 - 21:25 (UTC) | <dd class="notedate">Posted on March 20, 2018 - 21:25 (UTC) | ||
<dt class="note">[[User:vabene1111|vabene1111]] | <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 | ||
<code>[11111111] [[call]] [[BIS_fnc_numberDigits]]; {{codecomment|// returns [1,1,1,1,1,1,1,1]}} | <code>[11111111] [[call]] [[BIS_fnc_numberDigits]]; {{codecomment|// returns [1,1,1,1,1,1,1,1]}} | ||
[111111111] [[call]] [[BIS_fnc_numberDigits]]; {{codecomment|// returns [1,1,1,1,1,1,1,1,2]}} | [111111111] [[call]] [[BIS_fnc_numberDigits]]; {{codecomment|// returns [1,1,1,1,1,1,1,1,2]}} | ||
[1111111111111] [[call]] [[BIS_fnc_numberDigits]]; {{codecomment|// returns [1,1,1,1,1,1,1,1,0,6,5,6,0]}}</code> | [1111111111111] [[call]] [[BIS_fnc_numberDigits]]; {{codecomment|// returns [1,1,1,1,1,1,1,1,0,6,5,6,0]}}</code> | ||
</dl> | </dl> | ||
<!-- DISCONTINUE Notes --> | <!-- DISCONTINUE Notes --> |
Revision as of 16:46, 6 June 2018
Description
- Description:
- Break number into array of digits.
- Execution:
- call
- Groups:
- Uncategorised
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:
12345678 call BIS_fnc_numberDigits; // returns [1,2,3,4,5,6,7,8]
- Example 2:
123.9999 call BIS_fnc_numberDigits; // returns [1,2,3]
Additional Information
- See also:
- BIS_fnc_numberDigitsBIS_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
Notes
Bottom Section
- Posted on March 20, 2018 - 21:25 (UTC)
- vabene1111
-
Use this function with caution: Numbers with more than 8 digits will return wrong results
[11111111] call BIS_fnc_numberDigits; // returns [1,1,1,1,1,1,1,1] [111111111] call BIS_fnc_numberDigits; // returns [1,1,1,1,1,1,1,1,2] [1111111111111] call BIS_fnc_numberDigits; // returns [1,1,1,1,1,1,1,1,0,6,5,6,0]