Welcome, Guest Monday 21st April 2014, 00:29:26
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: SPON_formatNumber v0.1.0 (ACCEPTED)  (Read 1557 times)
0 Members and 1 Guest are viewing this topic.
Spooner
*
Offline Offline


Mostly useless


WWW
« on: 07 Nov 2007, 17:51:00 »

SPON_formatNumber v0.1.0
- Released: 2007-11-07
- SQF function in a single file
- Includes dialog-based test mission.

Description
Formats a number to a minimum integer width (e.g. 56 with 3 width would be "056") and/or to a specific number of decimal places (including padding with 0s and correct rounding). Numbers are always displayed fully, never being condensed using an exponent (e.g. the number 1.234e9 would be given as "1234000000").

Additionally, if required, it will separate the integer part of the number with the appropriate localized seperators as, for example, "21,002" or "1,000,000".

Limitations
Although the function works and will display the passed number correctly, due to the extremely limited accuracy of floating point values used within ArmA (presumably just single-precision / 32 bit), the output might not be as expected after about eight significant figures. Not my fault Whistle

Get SPON_formatNumber


* formatNumber.jpg (31.47 KB, 800x581 - viewed 209 times.)
« Last Edit: 12 Dec 2008, 12:31:56 by Spooner » Logged

[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)
LeeHunt
Former Staff
****
Offline Offline


John 21:25


« Reply #1 on: 12 Nov 2007, 00:48:05 »

i'll take a look at this...
Logged

JasonO
OFPEC Patron
****
Offline Offline


Oh no...


WWW
« Reply #2 on: 12 Nov 2007, 22:04:35 »

This should be helpful in a timer script I have.

No more 1:3 (1 minute, 3 seconds instead of 1:03) timers!
Logged

Pages: [1]   Go Up
  Send this topicPrint  
 
Jump to: