BIS fnc numberText: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "{{HashLink" to "{{Link")
 
(33 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= tkoh
____________________________________________________________________________________________
|version1= 1.00


| tkoh |= Game name
|game2= arma3
|version2= 0.50


|1.00|= Game version
|gr1= Math
____________________________________________________________________________________________


| <pre>/*
|gr2= Strings


Description:
|descr= Convert a number into string (avoiding scientific notation).
Convert a number into string (avoiding scientific notation)


Parameter(s):
|pr= It is very imprecise with larger numbers. See {{Link|#Example 3}}. It also does not work with floating point numbers.
_this: NUMBER


Returns:
|s1= [number, modulo] call [[BIS_fnc_numberText]]
STRING
*/
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_numberText]]; --> |= Syntax
|p1= number: [[Number]]


|p1= |= Parameter 1
|p2= modulo: [[Number]] - (Optional, default 3)


| |= Return value
|r1= [[String]]
____________________________________________________________________________________________


|x1= <code>[scalarNumber] call BIS_fnc_numberText</code> |=
|x1= <sqf>[4096] call BIS_fnc_numberText; // "4 096"</sqf>
____________________________________________________________________________________________


| |= See also
|x2= <sqf>[512, 1] call BIS_fnc_numberText; // "5 1 2"</sqf>


}}
|x3= <sqf>[999999999999] call BIS_fnc_numberText; // "909 999 995 904"</sqf>


<h3 style="display:none">Notes</h3>
|x4= <sqf>[1234.5678] call BIS_fnc_numberText; // "1 234"</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|seealso= [[BIS_fnc_numberDigits]] [[BIS_fnc_cutDecimals]]
</dl>
}}
 
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Numbers|{{uc:numberText}}]]
[[Category:Functions|{{uc:numberText}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:numberText}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:numberText}}]]

Latest revision as of 18:43, 4 January 2023

Hover & click on the images for description

Description

Description:
Convert a number into string (avoiding scientific notation).
Execution:
call
Problems:
It is very imprecise with larger numbers. See Example 3. It also does not work with floating point numbers.
Groups:
MathStrings

Syntax

Syntax:
[number, modulo] call BIS_fnc_numberText
Parameters:
number: Number
modulo: Number - (Optional, default 3)
Return Value:
String

Examples

Example 1:
[4096] call BIS_fnc_numberText; // "4 096"
Example 2:
[512, 1] call BIS_fnc_numberText; // "5 1 2"
Example 3:
[999999999999] call BIS_fnc_numberText; // "909 999 995 904"
Example 4:
[1234.5678] call BIS_fnc_numberText; // "1 234"

Additional Information

See also:
BIS_fnc_numberDigits 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