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)

Public Attributes

package Handle handle

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)

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


Member Typedef Documentation

typedef void* UFieldPos
 

Definition at line 680 of file UNumberFormat.d.

typedef void* ParseError
 

Definition at line 681 of file UNumberFormat.d.

typedef void* Handle [protected, inherited]
 

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

Definition at line 109 of file ICU.d.


Member Enumeration Documentation

enum Rounding
 

Enumeration values:
Ceiling 
Floor 
Down 
Up 
HalfEven 
HalfDown 
HalfUp 

Definition at line 684 of file UNumberFormat.d.

enum Pad
 

Enumeration values:
BeforePrefix 
AfterPrefix 
BeforeSuffix 
AfterSuffix 

Definition at line 695 of file UNumberFormat.d.

enum Style [private]
 

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

Definition at line 800 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 815 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 839 of file UNumberFormat.d.

enum Error [protected, inherited]
 

ICU error codes (the ones which are referenced)

Enumeration values:
OK 
BufferOverflow 

Definition at line 117 of file ICU.d.


Constructor & Destructor Documentation

~this  )  [inline]
 

Definition at line 719 of file UNumberFormat.d.


Member Function Documentation

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

Reimplemented in UCommonFormat.

Definition at line 707 of file UNumberFormat.d.

References ICU::testError().

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

Definition at line 728 of file UNumberFormat.d.

References UString::format().

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

Definition at line 742 of file UNumberFormat.d.

References UString::format().

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

Definition at line 756 of file UNumberFormat.d.

References UString::format().

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

Definition at line 770 of file UNumberFormat.d.

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

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

Definition at line 781 of file UNumberFormat.d.

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

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

Definition at line 792 of file UNumberFormat.d.

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

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

Definition at line 127 of file ICU.d.

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

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

Definition at line 145 of file ICU.d.

Referenced by UCalendar::add(), UText::compareFolded(), UConverter::decode(), UConverter::encode(), UResourceBundle::get(), UCalendar::get(), UResourceBundle::getBinary(), UResourceBundle::getInt(), UResourceBundle::getIntVector(), UCalendar::getLimit(), UResourceBundle::getLocale(), UCalendar::getMillis(), UConverter::getName(), UResourceBundle::getNextString(), UResourceBundle::getString(), UDateFormat::getTwoDigitYearStart(), UCalendar::inDaylightTime(), UDateFormat::parse(), UCalendar::roll(), UCalendar::setDate(), UCalendar::setDateTime(), UCalendar::setMillis(), UDecimalFormat::setPattern(), UMessageFormat::setPattern(), UCalendar::setTimeZone(), UDateFormat::setTwoDigitYearStart(), UResourceBundle::this(), this(), UMessageFormat::this(), UDateFormat::this(), and UCalendar::this().

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

Definition at line 155 of file ICU.d.

Referenced by UConverter::compareNames(), UResourceBundle::getResource(), UResourceBundle::getString(), UCalendar::getTimeZoneName(), UMessageFormat::setLocale(), UResourceBundle::this(), UMessageFormat::this(), UDateFormat::this(), UText::toLower(), ICU::toString(), and UText::toUpper().

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

Definition at line 175 of file ICU.d.

References ICU::toString().

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

Definition at line 184 of file ICU.d.

References strlen().

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

Definition at line 193 of file ICU.d.

References wcslen().

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

Definition at line 202 of file ICU.d.

References strlen().

Referenced by UConverter::detectSignature(), UResourceBundle::getKey(), UResourceBundle::getLocale(), UMessageFormat::getLocale(), and UConverter::getName().

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

Definition at line 213 of file ICU.d.

References wcslen().


Member Data Documentation

package Handle handle
 

Definition at line 678 of file UNumberFormat.d.

Referenced by UDateFormat::setNumberFormat().


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:13 2004 for Mango by doxygen 1.3.6