Index  Up  <<  >>  


Special Locale keys for price representation

MiniVend honors the standard POSIX keys:

    mon_decimal_point decimal_point 
    mon_thousands_sep thousands_sep 
    currency_symbol   int_currency_symbol
    frac_digits       p_cs_precedes

See the POSIX setlocale(3) man page for more information.

These will be used for formatting prices and will approximate the number format used in most countries. To set the price format to something that is exactly how you want it, you can use the special keys:

price_picture
MiniVend will format a currency number based on a ``picture'' given to it. The basic form is:

    Locale en_US price_picture "$ ###,###,###.##"

This is the presumably for locale en_US, the United States, and it would display 4452.3 as $ 4,445.30.

The same display can be achieved with:

     Locale en_US mon_thousands_sep ,
     Locale en_US mon_decimal_point .
     Locale en_US p_cs_precedes     1
     Locale en_US currency_symbol   $

A common price_picture for European countries would be ###.###.###,##, which would display the same number as 4.452,30. To add a franc notation at the end for the locale fr_FR, you would use the setting:

    Locale fr_FR price_picture "##.###,## fr"

IMPORTANT NOTE: The decimal point in use, set by mon_decimal_point, and the thousands separator mon_thousands_sep must match the settings in the picture. The frac_digits setting is not used in this case -- it is derived from the location of the decimal (if any).

The same setting for fr_FR above can be achieved with:

     Locale fr_FR mon_thousands_sep .
     Locale fr_FR mon_decimal_point ,
     Locale fr_FR p_cs_precedes     0
     Locale fr_FR currency_symbol   fr

If the number of digits is greater than the # locations in the picture, the digits will be changed to asterisks. An overflow number above would show as **.***,** fr.

picture
Same as price_picture, but sets the value returned if the [currency] tag is not used.

If the number of digits is greater than the # locations in the picture, the digits will be changed to asterisks, displaying something like **,***.**.


Index  Up  <<  >>