BIS fnc numberDigits: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "\[\[Category\:Function Group\: Numbers(\|\{\{[a-zA-Z0-9_:]+\}\})?\]\] " to "") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Function|Comments= | {{Function|Comments= | ||
| tkoh |Game name= | | tkoh |Game name= | ||
Line 9: | Line 8: | ||
|gr2 = Strings |GROUP2= | |gr2 = Strings |GROUP2= | ||
| Break number into array of digits. |Description= | | Break number into array of digits. |Description= | ||
| number call [[BIS_fnc_numberDigits]] |Syntax= | | number call [[BIS_fnc_numberDigits]] |Syntax= | ||
Line 19: | Line 16: | ||
| [[Array]] of [[Number|Numbers]] - Array of ''number'' digits |Return value= | | [[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> |Example 1= | |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> |Example 2= | |x2= <code>123.9999 [[call]] [[BIS_fnc_numberDigits]]; {{codecomment|// returns [1,2,3]}}</code> |Example 2= | ||
| [[BIS_fnc_numberText]], [[BIS_fnc_cutDecimals]] |See also= | | [[BIS_fnc_numberText]], [[BIS_fnc_cutDecimals]] |See also= |
Revision as of 23:19, 16 January 2021
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:
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_numberTextBIS_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]