BIS fnc numberDigits: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>([^<]*)\{\{cc\|([^{}]+)\}\} *<\/code>" to "<code>$1// $2</code>") |
Lou Montana (talk | contribs) m (Text replacement - "<code> *([^<|{]*) *<\/code>" to "<sqf>$1</sqf>") |
||
Line 19: | Line 19: | ||
|r1= [[Array]] of [[Number|Numbers]] - Array of ''number'' digits | |r1= [[Array]] of [[Number|Numbers]] - 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> | ||
|seealso= [[BIS_fnc_numberText]] [[BIS_fnc_cutDecimals]] | |seealso= [[BIS_fnc_numberText]] [[BIS_fnc_cutDecimals]] |
Revision as of 22:44, 12 July 2022
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 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]