public interface L10nFacade
For localization (l10n) functionality, like localizing messages.
Type Params | Return Type | Name and description |
---|---|---|
|
public java.lang.String |
format(java.lang.Object value, java.lang.String format) Format a Number, Timestamp, Date, Time, or Calendar object using the given format string. |
|
public java.lang.String |
format(java.lang.Object value, java.lang.String format, java.util.Locale locale, java.util.TimeZone tz) |
|
public java.lang.String |
formatCurrency(java.lang.Object amount, java.lang.String uomId, java.lang.Integer fractionDigits) Format currency amount for user to view. |
|
public java.lang.String |
formatCurrency(java.lang.Object amount, java.lang.String uomId) |
|
public java.lang.String |
formatCurrency(java.lang.Object amount, java.lang.String uomId, java.lang.Integer fractionDigits, java.util.Locale locale) |
|
public java.lang.String |
formatDateTime(java.util.Calendar input, java.lang.String format, java.util.Locale locale, java.util.TimeZone tz) |
|
public java.lang.String |
formatNumber(java.lang.Number input, java.lang.String format, java.util.Locale locale) |
|
public java.lang.String |
localize(java.lang.String original) Use the current locale (see ec.user.getLocale() method) to localize the message based on data in the moqui.basic.LocalizedMessage entity. |
|
public java.lang.String |
localize(java.lang.String original, java.util.Locale locale) Localize a String using the given Locale instead of the current user's. |
|
public java.sql.Date |
parseDate(java.lang.String input, java.lang.String format) |
|
public java.util.Calendar |
parseDateTime(java.lang.String input, java.lang.String format) |
|
public java.math.BigDecimal |
parseNumber(java.lang.String input, java.lang.String format) |
|
public java.sql.Time |
parseTime(java.lang.String input, java.lang.String format) |
|
public java.sql.Timestamp |
parseTimestamp(java.lang.String input, java.lang.String format) |
|
public java.sql.Timestamp |
parseTimestamp(java.lang.String input, java.lang.String format, java.util.Locale locale, java.util.TimeZone timeZone) |
|
public java.math.BigDecimal |
roundCurrency(java.math.BigDecimal amount, java.lang.String uomId, boolean precise, java.math.RoundingMode roundingMode) Round currency according to the currency's specified amount of digits and rounding method. |
|
public java.math.BigDecimal |
roundCurrency(java.math.BigDecimal amount, java.lang.String uomId, boolean precise, int roundingMethod) |
|
public java.math.BigDecimal |
roundCurrency(java.math.BigDecimal amount, java.lang.String uomId, boolean precise) |
|
public java.math.BigDecimal |
roundCurrency(java.math.BigDecimal amount, java.lang.String uomId) |
Format a Number, Timestamp, Date, Time, or Calendar object using the given format string. If no format string is specified the default for the user's locale and time zone will be used.
value
- The value to format. Must be a Number, Timestamp, Date, Time, or Calendar object.format
- The format string used to specify how to format the value.Format currency amount for user to view.
amount
- An object representing the amount, should be a subclass of Number.uomId
- The uomId (ISO currency code), required.fractionDigits
- Number of digits after the decimal point to display. If null defaults to number defined
by java.util.Currency.defaultFractionDigits() for the specified currency in uomId.Use the current locale (see ec.user.getLocale() method) to localize the message based on data in the moqui.basic.LocalizedMessage entity. The localized message may have variables inserted using the ${} syntax that when this is called through ec.resource.expand(). The approach here is that original messages are actual messages in the primary language of the application. This reduces issues with duplicated messages compared to the approach of explicit/artificial property keys. Longer messages (over 255 characters) should use an artificial message key with the actual value always coming from the database.
Localize a String using the given Locale instead of the current user's.
Round currency according to the currency's specified amount of digits and rounding method.
amount
- The amount in BigDecimal to be rounded.uomId
- The currency uomId (ISO currency code), requiredprecise
- A boolean indicating whether the currency should be treated with an additional digitroundingMode
- Rounding method to use (e.g. RoundingMode.HALF_UP)