Packagecom.adobe.portfolio.utils
Classpublic class GlobalizationUtil
InheritanceGlobalizationUtil Inheritance Object

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The GlobalizationUtil class is a set of globalization utility functions.



Public Methods
 MethodDefined By
  
formatDateTime(date:Date, dateStyle:String, timeStyle:String, locale:String):String
[static] Returns a formatted date and time string using the provided date and time formatting styles, according to the conventions of the specified locale.
GlobalizationUtil
  
formatNumber(number:Number, locale:String):String
[static] Returns a formatted number string according to the conventions of the specified locale.
GlobalizationUtil
  
formatSize(size:Number, locale:String):String
[static] Returns a formatted size string according to the conventions of the specified locale.
GlobalizationUtil
  
[static] Returns a text direction (left to right or right to left) based on the locale of the host.
GlobalizationUtil
  
parseNumber(numberStr:String, locale:String):Number
[static] Returns a number derived from the passed in string according to the conventions of the specified locale.
GlobalizationUtil
  
textDirection(host:INavigatorHost, str:String):String
[static] Returns a text direction (left to right or right to left) based on a text string.
GlobalizationUtil
Method Detail
formatDateTime()method
public static function formatDateTime(date:Date, dateStyle:String, timeStyle:String, locale:String):String

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns a formatted date and time string using the provided date and time formatting styles, according to the conventions of the specified locale.

Parameters

date:Date — Date to be formatted.
 
dateStyle:String — Specifies the style to use when formatting dates. The default is DateTimeStyle.SHORT.
 
timeStyle:String — Specifies the style to use when formatting times. The default is DateTimeStyle.MEDIUM.
 
locale:String — Specifies the locale to use when formatting dates/times. The default is LocaleID.DEFAULT.

Returns
String — Formatted date/time string.

See also

flash.globalization.DateTimeFormatter
flash.globalization.DateTimeStyle
flash.globalization.LocaleID
formatNumber()method 
public static function formatNumber(number:Number, locale:String):String

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns a formatted number string according to the conventions of the specified locale. Trailing zeros are supressed.

Parameters

number:Number — Number to be formatted.
 
locale:String — Specifies the locale to use when formatting the number. The default is LocaleID.DEFAULT.

Returns
String — Formatted number string.

See also

flash.globalization.NumberFormatter
flash.globalization.LocaleID
formatSize()method 
public static function formatSize(size:Number, locale:String):String

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns a formatted size string according to the conventions of the specified locale. The number is normalized to the closest formatted unit size.

Examples of formatted strings are: 1.445 KB, 12.50 MB, and 200 bytes

Parameters

size:Number — Size to be formatted.
 
locale:String — Specifies the locale to use when formatting the number. The default is LocaleID.DEFAULT.

Returns
String — Formatted size string.

See also

flash.globalization.NumberFormatter
flash.globalization.LocaleID
localeDirection()method 
public static function localeDirection(host:INavigatorHost):String

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns a text direction (left to right or right to left) based on the locale of the host.

Parameters

host:INavigatorHost — The INavigator instance that hosts the PDF portfolio navigator.

Returns
String — Text direction.

See also

com.adobe.portfolio.api.INavigatorHost
flash.globalization.LocaleID
flashx.textLayout.formats.Direction
parseNumber()method 
public static function parseNumber(numberStr:String, locale:String):Number

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns a number derived from the passed in string according to the conventions of the specified locale. It is assumed that the passed in string had been formatted using the same locale passed to this method.

Parameters

numberStr:String — Formatted string representation of a number.
 
locale:String — Specifies the locale to use when parsing the number. The default is LocaleID.DEFAULT.

Returns
Number — Number.

See also

flash.globalization.NumberFormatter
flash.globalization.LocaleID
textDirection()method 
public static function textDirection(host:INavigatorHost, str:String):String

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns a text direction (left to right or right to left) based on a text string. The text direction is based on the first character in the string. If the string is empty, then the direction of the locale is used.

Parameters

host:INavigatorHost — The INavigator instance that hosts the PDF portfolio navigator.
 
str:String — The text string that should be displayed either left to right or right to left.

Returns
String — Text direction.

See also

localeDirection
com.adobe.portfolio.api.INavigatorHost
flashx.textLayout.formats.Direction