Main Page | Class Hierarchy | Alphabetical List | Class List | 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

 this ()
 ~this ()

Public Attributes

package Handle handle

Static Public Attributes

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

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

Static Private Attributes

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 679 of file UNumberFormat.d.


Member Typedef Documentation

typedef void* UFieldPos
 

Definition at line 683 of file UNumberFormat.d.

typedef void* ParseError
 

Definition at line 684 of file UNumberFormat.d.

typedef void* Handle [protected, inherited]
 

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

Definition at line 114 of file ICU.d.


Member Enumeration Documentation

enum Rounding
 

Enumeration values:
Ceiling 
Floor 
Down 
Up 
HalfEven 
HalfDown 
HalfUp 

Definition at line 687 of file UNumberFormat.d.

enum Pad
 

Enumeration values:
BeforePrefix 
AfterPrefix 
BeforeSuffix 
AfterSuffix 

Definition at line 698 of file UNumberFormat.d.

enum Style [private]
 

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

Definition at line 706 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 721 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 745 of file UNumberFormat.d.

enum Error [protected, inherited]
 

ICU error codes (the ones which are referenced)

Enumeration values:
OK 
BufferOverflow 

Definition at line 148 of file ICU.d.


Constructor & Destructor Documentation

~this  )  [inline]
 

Definition at line 783 of file UNumberFormat.d.

~this  )  [inline, static]
 

Definition at line 927 of file UNumberFormat.d.


Member Function Documentation

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

Reimplemented in UCommonFormat.

Definition at line 771 of file UNumberFormat.d.

References ICU::testError().

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

Definition at line 792 of file UNumberFormat.d.

References UString::format(), and len.

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

Definition at line 806 of file UNumberFormat.d.

References UString::format(), and len.

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

Definition at line 820 of file UNumberFormat.d.

References UString::format(), and len.

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

Definition at line 834 of file UNumberFormat.d.

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

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

Definition at line 845 of file UNumberFormat.d.

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

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

Definition at line 856 of file UNumberFormat.d.

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

this  )  [inline, static]
 

Definition at line 918 of file UNumberFormat.d.

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

Definition at line 158 of file ICU.d.

Referenced by UConverter::detectSignature(), UString::format(), UCollator::getLocale(), and UConverter::this().

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

Definition at line 176 of file ICU.d.

Referenced by UCalendar::add(), USet::applyPattern(), UChar::charFromName(), UNormalize::check(), URegex::clone(), UNormalize::compare(), UDomainName::compare(), 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().

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

Definition at line 186 of file ICU.d.

References string.

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().

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

Definition at line 208 of file ICU.d.

References string.

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

Definition at line 230 of file ICU.d.

References strlen().

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

Definition at line 239 of file ICU.d.

References wcslen().

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

Definition at line 248 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().

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

Definition at line 259 of file ICU.d.

References wcslen().


Member Data Documentation

package Handle handle
 

Definition at line 681 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 873 of file UNumberFormat.d.

FunctionLoader Bind [] targets [static]
 

Initial value:

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

Definition at line 899 of file UNumberFormat.d.


The documentation for this class was generated from the following file:
Generated on Sat Apr 9 20:11:47 2005 for Mango by doxygen 1.3.6