| 1 |
% This file is embedded in datatool-user.pdf version 3.4.3 2025-12-04 |
| 2 |
% Example 43 Currency Formats (GB and IE Regions) |
| 3 |
% Label: "ex:multiregioncurrency" |
| 4 |
% arara: xelatex |
| 5 |
% arara: pdfcrop |
| 6 |
\documentclass[12pt]{article} |
| 7 |
\pagestyle{empty} |
| 8 |
\usepackage[locales={en-GB,en-IE}]{datatool-base} |
| 9 |
\DTLsetLocaleOptions{GB}{ number-style = education } |
| 10 |
\DTLsetup{numeric={auto-reformat}} |
| 11 |
\begin{document} |
| 12 |
\DTLGBLocaleHook |
| 13 |
Currency code: \DTLCurrencyCode. |
| 14 |
Currency symbol: \DTLCurrencySymbol. |
| 15 |
|
| 16 |
\DTLdecimaltocurrency{12345.678}{\GBformattedresult} |
| 17 |
Formatted: \GBformattedresult. |
| 18 |
(Numeric value: \DTLdatumvalue{\GBformattedresult}.) |
| 19 |
|
| 20 |
Parsing £12 345.67. |
| 21 |
\DTLparse\GBparsed{£12 345.67} |
| 22 |
|
| 23 |
|
| 24 |
Parsed: \GBparsed. |
| 25 |
(Numeric value: \DTLdatumvalue{\GBparsed}.) |
| 26 |
|
| 27 |
\DTLIELocaleHook |
| 28 |
Currency code: \DTLCurrencyCode. |
| 29 |
Currency symbol: \DTLCurrencySymbol. |
| 30 |
|
| 31 |
\DTLdecimaltocurrency{12345.678}{\IEformattedresult} |
| 32 |
Formatted: \IEformattedresult. |
| 33 |
(Numeric value: \DTLdatumvalue{\IEformattedresult}.) |
| 34 |
|
| 35 |
Parsing €12,345.67. |
| 36 |
\DTLparse\IEparsed{€12,345.67} |
| 37 |
|
| 38 |
|
| 39 |
Parsed: \IEparsed. |
| 40 |
(Numeric value: \DTLdatumvalue{\IEparsed}.) |
| 41 |
|
| 42 |
\DTLsetup{numeric={currency-symbol-style=iso}} |
| 43 |
\DTLsetLocaleOptions{GB,IE}{currency-symbol-position=after} |
| 44 |
\begin{enumerate} |
| 45 |
\item \GBformattedresult. |
| 46 |
\item \GBparsed. |
| 47 |
\item \IEformattedresult. |
| 48 |
\item \IEparsed. |
| 49 |
\end{enumerate} |
| 50 |
\end{document} |