% This file is embedded in datatool-user.pdf version 3.4.5 2026-08-23
% Example 42 Currency Formats (GB Region)
% Label: "ex:regionGBcurrency"
% arara: xelatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[locales={en-GB}]{datatool-base}

\begin{document}
Currency code: \DTLCurrencyCode.
Currency symbol: \DTLCurrencySymbol. 

\DTLdecimaltocurrency{12345.678}{\formattedresult}
Formatted: \formattedresult.
(Numeric value: \DTLdatumvalue{\formattedresult}.) 

\DTLparse\parsed{£28,342.64}
String value: \parsed.
Numeric value: \DTLdatumvalue{\parsed}. 

\DTLparse\parsed{€19,234.56}
String value: \parsed.
Numeric value: \DTLdatumvalue{\parsed}. 

\DTLsetLocaleOptions{GB}{
 number-style=old,
 currency-symbol-prefix
}
(GB settings: number-style=old, currency-symbol-prefix=true.) 

\DTLdecimaltocurrency{12345.678}{\formattedresult}
Formatted: \formattedresult.
(Numeric value: \DTLdatumvalue{\formattedresult}.) 

\DTLparse\parsed{£28,342.648}
String value: \parsed.
Numeric value: \DTLdatumvalue{\parsed}. 

\DTLsetup{
 numeric={
  auto-reformat,
  region-currency-prefix=smallcaps
 }
}
(Numeric settings: auto-reformat, region-currency-prefix=smallcaps.) 

\DTLparse\parsed{£28,342.648}
String value: \parsed.
Numeric value: \DTLdatumvalue{\parsed}.
Currency symbol: \DTLdatumcurrency{\parsed}. 
\end{document}
