Page 1 of 1

Formatted Numeric Data

Posted: Thu May 18, 2006 23:15
by Rackle
I've Wikied a class to format numeric data according to the rules of various locales (language, country, currency). There is also limited support for custom formatting numeric values in special formats such as telephone numbers, credit card number, etc. Hopefully it can be useful to others.

Posted: Fri Jun 23, 2006 15:25
by Rackle
Updated to v0.5.0.

Fixed a memory leak within formatNumber() and another within _convertLocalAndGmt(). The ICU Library falsely reports memory leaks via the

Code: Select all

#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

...

_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
approach. To palliate this I've added a constructor and destructor to call the u_cleanup() function, which deallocates the memory used by the library. My concern is that should the library be used outside of this class then calling this function might cause other problems. In this case the constructor should be used with a false ICU icu(false) to prevent the destructor from deallocating the ICU Library's memory.

Posted: Fri Dec 01, 2006 17:47
by Rackle
Made compatible with CEGUI v0.5 release

Posted: Fri Dec 01, 2006 21:51
by scriptkid
Hi,

i read about this page for the first time. Nice work! :-)