Miva Merchant: E-commerce Solutions to Grow Online
spacer gif

Chapter 6

Currency Modules

Introduction

This module type adds formatting to a decimal number that is passed to it. The module takes the decimal number and formats it into the proper currency layout.

In addition to simple formatting, a currency module could convert values of various currencies. It could display US currency, Eurodollars, or Canadian currency using the daily rate of exchange data to give updated values from day to day.

The currency module could go one step further and do a lookup every hour to update the currency values.

Module type: CURRENCY

Required Functions

Refer to the following for all the functions every store module must contain:

In addition, this module must contain the following function(s):

CurrencyModule_AddFormatting

Receives a decimal number, and returns a string which is the number converted to the formatted style desired for output in html, such as to display the national currency.

CurrencyModule_AddFormatPlainText

Receives a decimal number returns a string which is the number converted to the formatted style desired for output in plain text.

CurrencyModule_AddFormatPlainTextShort

Receives a decimal number returns a string which is the number converted to the formatted style desired for output in plain text that is as short as possible.