Package DE_EPAGES::Object::API::Object::SiteLocale
object interface for SiteLocale. Provides information about regional settings. Includes functions for locale-specific number and currency formats.
Base |
DE_EPAGES::Object::API::Object::Object |
Functions
- className
- dbPackage
- format
- formatAttributes
- formatDateTime
- formatFloat
- formatInteger
- formatMoney
- parse
- parseDateTime
- roundMoney
className
Returns the class name, used for DAL access.
Syntax |
$ClassName = $SiteLocale->className; |
Return |
|
dbPackage
Returns the database package, used for DAL access.
Syntax |
$DbPackage = $SiteLocale->dbPackage; |
Return |
|
format
Formats numbers in float/integer/money and DateTime objects to date/datetime/time strings.
Syntax |
$Formatted = $Object->format($Value, $Format, $CurrencyID); |
Input |
|
Return |
|
formatAttributes
Returns the format options for number formatter.
Syntax |
$hFormatAttributes = $Object->formatAttributes($CurrencyID); |
Input |
|
Return |
|
formatDateTime
Returns the formatted date and time string in the Store time zone.
Syntax |
$Formatted = $Object->formatDateTime($DateTime, $Type); $Formatted = $Object->formatDateTime($DateTime, $Type, $Pattern); |
Example |
print $Object->formatDateTime( DateTime->now(), 'date' ); |
Input |
|
Return |
|
formatFloat
Returns the formatted number (insert thousand sep and decimal point).
Syntax |
$Formatted = $Object->formatFloat($Number); my $Formatted = $Object->formatFloat($Number, $Precision); |
Example |
print $Object->formatFloat( 12345.6789, 3 ); |
Input |
|
Return |
|
formatInteger
Returns the formatted number (insert thousand sep).
Syntax |
my $Formatted = $Object->formatInteger($Number); |
Input |
|
Return |
|
formatMoney
Returns the formatted number (insert thousand sep and decimal point).
Syntax |
$Formatted = $Object->formatMoney($Number, $CurrencyID); |
Input |
|
Return |
|
parse
Parse a formatted numbers of float/integer/money.
Syntax |
$Value = $Object->parse($Formatted, $CurrencyID); |
Input |
|
Return |
|
parseDateTime
Parse a formatted date and time strings. The current Store time zone is assumed.
Syntax |
$DateTime = $Object->parseDateTime($Formatted, $Type, $Pattern); |
Input |
|
Return |
|
roundMoney
Round number for money (formatAttributes includes MinorUnitCurrency).
Syntax |
$Rounded = $Object->roundMoney($Number, $CurrencyID); |
Input |
|
Return |
|