Number usage defines the way a number is used in an application. For example, by using number usage codes in your WebSphere Commerce code, you can choose the way you would like that number (currency or quantity) to be formatted/rounded. These codes (defined in the NUMBRUSG table) allow the number to be formatted according to the rules specified for that type of number usage in the CURFORMAT, CURFMTDESC, QTYFORMAT and QTYFMTDESC tables. This allows stores to format numbers in different ways to meet the requirements of a variety of situations.
Each row in the NUMBRUSG table contains a record for a certain type of number usage. The following lists the pre-defined number usages that are allowed in theNUMBRUSGtable:
- com.ibm.commerce.default
Used when there is no record for another number usage or a number usage is not
specified on any of the currency/quantity formatting beans or the
currency/quantity manager API. com.ibm.commerce.unitPrice
Used for formatting unit prices retrieved from an offer (see OFFER and OFFERPRICE tables). This number usage is used to round unit prices in the ORDERITEMS table and product prices on display pages. - com.ibm.commerce.listPrice
Used for formatting list prices retrieved from the LISTPRICE table.
These entries should not be changed. All formatting records in the CURFORMAT, CURFMTDESC, QTYFORMAT and QTYFMTDESC tables specify the default number usage for formatting unit prices and list prices. To have WebSphere Commerce format unit prices or list prices differently, you must add rows to the CURFORMAT table for the appropriate number usages.
When your application uses the CurrencyManager or QuantityManager to round or format amounts, you can specify the appropriate number usage code in the CODE column of the NUMBRUSG table. The CurrencyManager or QuantityManager uses the formatting rule for the specified number usage, if it exists.
Note: When you create a row in the NUMBRUSG, CURFORMAT, or QTYFORMAT table, you must also create a row in the NUMBRUSGDS, QTYFMTDESC, or QTYFMTDESC table for each supported language.