Adding a currency to WebSphere Commerce

WebSphere Commerce comes populated with many currencies. If the currency that your store must support is not provided by default, you can add a currency to WebSphere Commerce.

About this task

The list of currencies that are supported by default can be found in the following file:
  • AIXLinux WC_installdir/schema/xml/wcs.bootstrap_multi_en_US_base.xml
  • For IBM i OS operating system WC_userdir/schema/xml/wcs.bootstrap_multi_en_US_base.xml
  • Windows WC_installdir\schema\xml\wcs.bootstrap_multi_en_US_base.xml
  • WebSphere Commerce Developer WCDE_installdir\schema\xml\wcs.bootstrap_multi_en_US_base.xml
  • WC_installdir/schema/xml/wcs.bootstrap_multi_en_US_base.xml

To add a currency that is not supported by default to WebSphere Commerce as a site supported currency:

Procedure

  1. Add your national currency as a site-supported currency:
    
    insert into setcurr (setccurr, setccode, setcexp) 
    values (<Alphabetic currency code as per ISO 4217>,
    <Numeric currency code as per ISO 4217>,
    <The exponential value by which a subunit of the currency (such
    as cents)
    is multiplied to get the main currency unit>)
    
    For example,
    
    insert into setcurr (setccurr, setccode, setcexp) values ('THB',
    818, -2)
    
  2. Add a description to your national currency at the site level for your language_id.
    You can add a description to your national currency in as many languages as your system supports.
    
    insert into setcurrdsc (setccurr, language_id, description) values
    (<Alphabetic currency code>, <language_id>,
    <description>)
    
  3. Add a currency formatting rule.
    insert into curformat (storeent_id, setccurr, roundingmultiple, numbrusg_id, roundingmethod, decimalplaces)
    values (<storeentity> ,<Alphabetic currency code>, <Rounding multiple according to national law or practice.
    For example, specify 5 to round dollars to the nearest five cent piece. The default value is 1>,
    <The currency formatting rule which is refer to the table NUMBRUSG.>,
    <How to round to a multiple of ROUNDINGMULTIPLE: R = round normally - up or down - to the nearest multiple
    T = truncate - round down for positive amounts, round up for negative amounts>, 
    <The number of decimal places in a rounded or truncated monetary amount>);
    For example,
    insert into curformat (storeent_id, setccurr, roundingmultiple,
    numbrusg_id, 
    roundingmethod, decimalplaces, minapproveamount) values
    (-1,'THB',1,-1,'R',0,NULL)
    
    
    insert into curformat (storeent_id, setccurr, roundingmultiple,
    numbrusg_id, 
    roundingmethod, decimalplaces, minapproveamount) values
    (-1,'THB',1,-4,'R',0,NULL)
    
    
    insert into curformat (storeent_id, setccurr, roundingmultiple,
    numbrusg_id,
    roundingmethod, decimalplaces, minapproveamount) values
    (-1,'THB',1,-5,'R',0,NULL)
    
  4. Add a currency formatting description.
    
    insert into curfmtdesc (storeent_id, setccurr, language_id,
    currencysymbol,
    customizedcurrstr, currencyprefixpos, currencysuffixpos,
    displaylocale,
    currencyprefixneg, currencysuffixneg, radixpoint, groupingchar,
    numberpattern, description) values (-1, 'THB', -11, 'B', null, 'B',
    null,
    null, 'B-', null, null, null, '#,##0.00', null)
    
    For more information, see CURFMTDESC.
  5. Add a conversion rule between the default currency of the store and the created currency:
    
    insert into curconvert (storeent_id, fromcurr, tocurr, factor,
    multiplyordivide, bidirectional, updatable, curconvert_id)
    values(-1,'USD','THB','44.62','M','Y','Y',-12)
    

Results

For more information, see CURCONVERT.