<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% This file is embedded in datatool-user.pdf version 3.2 2025-03-14
% Example 44 Defining a Currency
% Label: "ex:defcurr"
% arara: xelatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
% This is an example document to demonstrate provided commands
 % To create your own region ldf file, see https://github.com/nlct/datatool-regions
 \usepackage{datatool-base}

\begin{document}
Default currency: \DTLCurrencyCode.
\DTLdecimaltocurrency{1234.567}{\result}
Formatted value: \result. 

Â£1.99: \DTLifcurrency{Â£1.99}{currency}{not currency};
\DTLfmtcurrency{Â£}{1.99}: \DTLifcurrency{\DTLfmtcurrency{Â£}{1.99}}{currency}{not currency}. 

Defining GBP.
\DTLdefcurrency{GBP}{\pounds}{Â£}
Default currency: \DTLCurrencyCode. 

Â£1.99: \DTLifcurrency{Â£1.99}{currency}{not currency}. 

Switching to GBP.\DTLsetdefaultcurrency{GBP}
Default currency: \DTLCurrencyCode. 

\DTLdecimaltocurrency{1234.567}{\result}
Formatted value: \result. 

\renewcommand{\dtlcurrdefaultfmt}{\dtlcurrsuffixfmt} \renewcommand{\DTLcurrCodeOrSymOrChar}[3]{#1} Formatted value: \result. 

\DTLaddall{\result}{\pounds2.50,\DTLcurrGBP 1.25,Â£0.25}
Formatted value: \result. 
\end{document}
</pre></body></html>