Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

UNumberFormat Class Reference

Inheritance diagram for UNumberFormat:

ICU UCommonFormat URuleBasedFormat UCurrencyFormat UDecimalFormat UDurationFormat UPercentFormat UScientificFormat USpelloutFormat List of all members.

Public Types

typedef void * UFieldPos
typedef void * ParseError
enum  Rounding {
  Ceiling, Floor, Down, Up,
  HalfEven, HalfDown, HalfUp
}
enum  Pad { BeforePrefix, AfterPrefix, BeforeSuffix, AfterSuffix }

Public Member Functions

 this (Style style, char[] pattern, inout ULocale locale)
 ~this ()
void format (UString dst, int number, UFieldPos p=null)
void format (UString dst, long number, UFieldPos p=null)
void format (UString dst, double number, UFieldPos p=null)
int parseInteger (UText src, uint *index=null)
long parseLong (UText src, uint *index=null)
double parseDouble (UText src, uint *index=null)

Static Public Member Functions

static this ()
static ~this ()

Public Attributes

package Handle handle

Static Public Attributes

static FunctionLoader Bind[] targets

Private Types

enum  Style {
  PatternDecimal, Decimal, Currency, Percent,
  Scientific, Spellout, Ordinal, Duration,
  RuleBased, Default = Decimal, Ignore = PatternDecimal
}
enum  Attribute {
  ParseIntOnly, GroupingUsed, DecimalAlwaysShown, MaxIntegerDigits,
  MinIntegerDigits, IntegerDigits, MaxFractionDigits, MinFractionDigits,
  FractionDigits, Multiplier, GroupingSize, RoundingMode,
  RoundingIncrement, FormatWidth, PaddingPosition, SecondaryGroupingSize,
  SignificantDigitsUsed, MinSignificantDigits, MaxSignificantDigits, LenientParse
}
enum  Symbol {
  DecimalSeparator, GroupingSeparator, PatternSeparator, Percent,
  ZeroDigit, Digit, MinusSign, PlusSign,
  Currency, IntlCurrency, MonetarySeparator, Exponential,
  Permill, PadEscape, Infinity, Nan,
  SignificantDigit, FormatSymbolCount
}
typedef void * Handle
enum  Error { OK, BufferOverflow = 15 }

Static Private Member Functions

static bool isError (Error e)
static void testError (Error e, char[] msg)
static char * toString (char[] string)
static wchar * toString (wchar[] string)
static uint length (char *s)
static uint length (wchar *s)
static char[] toArray (char *s)
static wchar[] toArray (wchar *s)

Static Private Attributes

static void * library

Detailed Description

UNumberFormat provides functions for formatting and parsing a number. Also provides methods for determining which locales have number formats, and what their names are.

UNumberFormat helps you to format and parse numbers for any locale. Your code can be completely independent of the locale conventions for decimal points, thousands-separators, or even the particular decimal digits used, or whether the number format is even decimal. There are different number format styles like decimal, currency, percent and spellout

See this page for full details.

Definition at line 680 of file UNumberFormat.d.


Member Typedef Documentation

typedef void* UFieldPos
 

Definition at line 684 of file UNumberFormat.d.

typedef void* ParseError
 

Definition at line 685 of file UNumberFormat.d.

typedef void* Handle [protected, inherited]
 

Use this for the primary argument-type to most ICU functions

Definition at line 112 of file ICU.d.


Member Enumeration Documentation

enum Rounding
 

Enumeration values:
Ceiling 
Floor 
Down 
Up 
HalfEven 
HalfDown 
HalfUp 

Definition at line 688 of file UNumberFormat.d.

enum Pad
 

Enumeration values:
BeforePrefix 
AfterPrefix 
BeforeSuffix 
AfterSuffix 

Definition at line 699 of file UNumberFormat.d.

enum Style [private]
 

Enumeration values:
PatternDecimal 
Decimal 
Currency 
Percent 
Scientific 
Spellout 
Ordinal 
Duration 
RuleBased 
Default 
Ignore 

Definition at line 707 of file UNumberFormat.d.

enum Attribute [private]
 

Enumeration values:
ParseIntOnly 
GroupingUsed 
DecimalAlwaysShown 
MaxIntegerDigits 
MinIntegerDigits 
IntegerDigits 
MaxFractionDigits 
MinFractionDigits 
FractionDigits 
Multiplier 
GroupingSize 
RoundingMode 
RoundingIncrement 
FormatWidth 
PaddingPosition 
SecondaryGroupingSize 
SignificantDigitsUsed 
MinSignificantDigits 
MaxSignificantDigits 
LenientParse 

Definition at line 722 of file UNumberFormat.d.

enum Symbol [private]
 

Enumeration values:
DecimalSeparator 
GroupingSeparator 
PatternSeparator 
Percent 
ZeroDigit 
Digit 
MinusSign 
PlusSign 
Currency 
IntlCurrency 
MonetarySeparator 
Exponential 
Permill 
PadEscape 
Infinity 
Nan 
SignificantDigit 
FormatSymbolCount 

Definition at line 746 of file UNumberFormat.d.

enum Error [protected, inherited]
 

ICU error codes (the ones which are referenced)

Enumeration values:
OK 
BufferOverflow 

Definition at line 146 of file ICU.d.


Constructor & Destructor Documentation

~this  )  [inline]
 

Definition at line 784 of file UNumberFormat.d.

static ~this  )  [inline, static]
 

Definition at line 928 of file UNumberFormat.d.


Member Function Documentation

this Style  style,
char[]  pattern,
inout ULocale  locale
[inline]
 

Reimplemented in UCommonFormat.

Definition at line 772 of file UNumberFormat.d.

References ICU::testError().

void format UString  dst,
int  number,
UFieldPos  p = null
[inline]
 

Definition at line 793 of file UNumberFormat.d.

References UString::format().

void format UString  dst,
long  number,
UFieldPos  p = null
[inline]
 

Definition at line 807 of file UNumberFormat.d.

References UString::format().

void format UString  dst,
double  number,
UFieldPos  p = null
[inline]
 

Definition at line 821 of file UNumberFormat.d.

References UString::format().

int parseInteger UText  src,
uint *  index = null
[inline]
 

Definition at line 835 of file UNumberFormat.d.

References UText::content, and UText::len.

long parseLong UText  src,
uint *  index = null
[inline]
 

Definition at line 846 of file UNumberFormat.d.

References UText::content, and UText::len.

double parseDouble UText  src,
uint *  index = null
[inline]
 

Definition at line 857 of file UNumberFormat.d.

References UText::content, and UText::len.

static this  )  [inline, static]
 

Definition at line 919 of file UNumberFormat.d.

static bool isError Error  e  )  [inline, static, protected, inherited]
 

Definition at line 156 of file ICU.d.

Referenced by UCollator::getLocale().

static void testError Error  e,
char[]  msg
[inline, static, protected, inherited]
 

Definition at line 174 of file ICU.d.

Referenced by UCalendar::add(), USet::applyPattern(), UChar::charFromName(), UNormalize::check(), URegex::clone(), UNormalize::compare(), UDomainName::compare(), UText::compareFolded(), UConverter::UTranscoder::convert(), UEnumeration::count(), UConverter::decode(), UConverter::encode(), URegex::end(), UTransform::execute(), USearch::first(), UResourceBundle::get(), UCalendar::get(), UCollator::getAttribute(), UResourceBundle::getBinary(), UCollator::getBound(), UChar::getCharName(), UChar::getComment(), UCollator::getContractions(), URegex::getFlags(), UResourceBundle::getInt(), UResourceBundle::getIntVector(), UCalendar::getLimit(), UResourceBundle::getLocale(), UCalendar::getMillis(), UConverter::getName(), UResourceBundle::getNextString(), URegex::getPattern(), UCollator::getShortDefinitionString(), UResourceBundle::getString(), UCollator::getTailoredSet(), UDateFormat::getTwoDigitYearStart(), UCollator::getVariableTop(), URegex::groupCount(), UCalendar::inDaylightTime(), UNormalize::isNormalized(), USearch::last(), URegex::match(), USearch::next(), URegex::next(), UEnumeration::next(), UCollator::normalizeShortDefinitionString(), UDateFormat::parse(), USearch::previous(), URegex::probe(), URegex::replaceAll(), URegex::replaceFirst(), URegex::reset(), UEnumeration::reset(), UCalendar::roll(), UCollator::setAttribute(), USearch::setCollator(), UCalendar::setDate(), UCalendar::setDateTime(), UTransform::setFilter(), USearch::setIterator(), UCalendar::setMillis(), USearch::setOffset(), USearch::setPattern(), UDecimalFormat::setPattern(), UMessageFormat::setPattern(), USearch::setText(), URegex::setText(), UBreakIterator::setText(), UCalendar::setTimeZone(), UDateFormat::setTwoDigitYearStart(), UCollator::setVariableTop(), URegex::split(), URegex::start(), UTransform::this(), UStringPrep::this(), USet::this(), USearch::this(), UResourceBundle::this(), URegex::this(), this(), UMessageFormat::this(), UDateFormat::this(), UCollator::this(), UCalendar::this(), UBreakIterator::this(), URuleIterator::this(), and UText::toUtf8().

static char* toString char[]  string  )  [inline, static, protected, inherited]
 

Definition at line 184 of file ICU.d.

Referenced by UChar::charFromName(), UConverter::compareNames(), UCollator::getDisplayName(), UResourceBundle::getResource(), UCollator::getShortDefinitionString(), UResourceBundle::getString(), UCalendar::getTimeZoneName(), UCollator::normalizeShortDefinitionString(), UMessageFormat::setLocale(), UStringPrep::this(), UResourceBundle::this(), UDateFormat::this(), UCollator::this(), UBreakIterator::this(), UText::toLower(), and UText::toUpper().

static wchar* toString wchar[]  string  )  [inline, static, protected, inherited]
 

Definition at line 206 of file ICU.d.

static uint length char *  s  )  [inline, static, protected, inherited]
 

Definition at line 228 of file ICU.d.

References strlen().

Referenced by UConverter::UTranscoder::convert().

static uint length wchar *  s  )  [inline, static, protected, inherited]
 

Definition at line 237 of file ICU.d.

References wcslen().

static char [] toArray char *  s  )  [inline, static, protected, inherited]
 

Definition at line 246 of file ICU.d.

References strlen().

Referenced by UConverter::detectSignature(), UResourceBundle::getKey(), UResourceBundle::getLocale(), UMessageFormat::getLocale(), UCollator::getLocale(), UConverter::getName(), UChar::getPropertyName(), UChar::getPropertyValueName(), and UConverter::opApply().

static wchar [] toArray wchar *  s  )  [inline, static, protected, inherited]
 

Definition at line 257 of file ICU.d.

References wcslen().


Member Data Documentation

package Handle handle
 

Definition at line 682 of file UNumberFormat.d.

Referenced by UDateFormat::setNumberFormat().

void* library [static, private]
 

Bind the ICU functions from a shared library. This is complicated by the issues regarding D and DLLs on the Windows platform

Definition at line 874 of file UNumberFormat.d.

FunctionLoader Bind [] targets [static]
 

Initial value:

 
                [
                {cast(void**) &unum_open,        "unum_open"}

Definition at line 900 of file UNumberFormat.d.


The documentation for this class was generated from the following file:
Generated on Sat Dec 24 17:28:43 2005 for Mango by  doxygen 1.4.0