Type: recommended
         Title: Locale dependent digit grouping
     Posted by: [EMAIL PROTECTED]
      Affected: unotools
Effective from: CWS locales30


*Summary*
--------
#include <unotools/localedatawrapper.hxx>
class LocaleDataWrapper
{
[...]
+   const ::com::sun::star::uno::Sequence< sal_Int32 > getDigitGrouping() const;
[...]
};

#include <unotools/digitgroupingiterator.hxx>
namspace utl {
class DigitGroupingIterator
{
    explicit DigitGroupingIterator( const ::com::sun::star::uno::Sequence< 
sal_Int32 > & rGroupings );
[...]
};
}


*Description*
-------------
Digit grouping (AKA thousands) in fact may be locale dependent.

Class LocaleDataWrapper now supports a method getDigitGrouping() that
returns a sequence containing a rule for grouping positions. See below
for details. This sequence may be used with the already existing
::rtl::math::doubleToString() method or the new class
DigitGroupingIterator. The LocaleDataWrapper methods getNum() and
getCurr() that get a bUseThousandSep parameter passed internally make
use of the grouping rules, as does the number formatter.

#include <unotools/localedatawrapper.hxx>
class LocaleDataWrapper
{
[...]
    /** Obtain digit grouping. The usually known grouping by
        thousands (#,###) is actually only one of possible
        groupings. Another one, for example, used in India is
        group by 3 and then by 2 indefinitely (#,##,###). The
        integer sequence returned here specifies grouping from
        right to left (!), with a 0 entry designating the end of
        rules and the previous value to be repeated indefinitely.
        Hence the sequence {3,0} specifies the usual grouping by
        thousands, whereas the sequence {3,2,0} specifies Indian
        grouping. The sal_Int32* getConstArray() can be passed
        directly to the ::rtl::math::doubleToString() methods as
        argument for the pGroups parameter. */
    const ::com::sun::star::uno::Sequence< sal_Int32 >
getDigitGrouping() const;
[...]
};


#include <unotools/digitgroupingiterator.hxx>
namspace utl {
[...]
class DigitGroupingIterator
{
[...]
};
}

As the API-change feature mail form respectively its underlying database
doesn't allow for the necessary amount of characters needed to include the
class' information, please lookup details in the header file
unotools/inc/unotools/digitgroupingiterator.hxx



Send feedback to [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to