How to extract the currency symbol?
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
Within the Datatool package, we find the currency data type.
A currency data type is a currency symbol followed by an integer or real number.
How can I extract the currency symbol out of a currency data ??
documentclassarticle
usepackagedatatool
newcommandsplitCurrency[1]%
noindent Splitting #1 into its value and symbol parts:
DTLifcurrency#1% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#1theValue theValue%
\The symbol: ??
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$ 123%
enddocument
datatool
add a comment |Â
up vote
4
down vote
favorite
Within the Datatool package, we find the currency data type.
A currency data type is a currency symbol followed by an integer or real number.
How can I extract the currency symbol out of a currency data ??
documentclassarticle
usepackagedatatool
newcommandsplitCurrency[1]%
noindent Splitting #1 into its value and symbol parts:
DTLifcurrency#1% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#1theValue theValue%
\The symbol: ??
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$ 123%
enddocument
datatool
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
Within the Datatool package, we find the currency data type.
A currency data type is a currency symbol followed by an integer or real number.
How can I extract the currency symbol out of a currency data ??
documentclassarticle
usepackagedatatool
newcommandsplitCurrency[1]%
noindent Splitting #1 into its value and symbol parts:
DTLifcurrency#1% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#1theValue theValue%
\The symbol: ??
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$ 123%
enddocument
datatool
Within the Datatool package, we find the currency data type.
A currency data type is a currency symbol followed by an integer or real number.
How can I extract the currency symbol out of a currency data ??
documentclassarticle
usepackagedatatool
newcommandsplitCurrency[1]%
noindent Splitting #1 into its value and symbol parts:
DTLifcurrency#1% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#1theValue theValue%
\The symbol: ??
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$ 123%
enddocument
datatool
asked Aug 16 at 8:58
Joseph Marie
1436
1436
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
After running DTLifcurrency
or the internal equivalent @dtl@checknumerical
, the currency symbol is stored in @dtl@currency
, so you can use
documentclassarticle
usepackagedatatool
makeatletter
newcommandgetcurrencysymbol[2]%
@dtl@checknumerical#1%
ifnum@dtl@datatype=3relaxlet#2@dtl@currencyelsedef#2??fi
makeatother
newcommandsplitCurrency[1]%
noindent Splitting #1 into its value and symbol parts:
DTLifcurrency#1% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#1theValuetheValue%
\The symbol: getcurrencysymbol#1theCurrencytheCurrency
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$ 123%
enddocument
Anyway to force the extension within getcurrencysymbol, so that I don't have to repeat expandaftertheCurrencyrelax on each use?
â Joseph Marie
Aug 16 at 10:52
@JosephMarie I do not understand your question. Why would you have to repeatexpandaftertheCurrencyrelax
?expandaftertheCurrencyrelax
would try to expand the non-expandablerelax
, soexpandafter
is useless here.
â Marcel Krüger
Aug 16 at 11:05
When I run getcurrencysymbol$ 123symbol% DTLnewdbentrydataSymbolsymbol%, I get an Error (Extra else....). When I do DTLnewdbentrydataSymbolexpandaftersymbolrelax%, there is no error.
â Joseph Marie
Aug 16 at 12:18
2
@JosephMarie that's imho a bug in datatool, it fails if the value starts with something that could be a currency. Your expandafter command hides this. You could also userelaxsymbol
. I wrote Nicola a mail.
â Ulrike Fischer
Aug 16 at 14:28
add a comment |Â
up vote
5
down vote
documentclassarticle
usepackagedatatool
DTLnewcurrencysymbolâ¬
defsplitCurrency#1noindent Splitting #1 into its value and symbol parts:
splitCurrencyA#1;
defsplitCurrencyA#1#2;%
DTLifcurrency#1#2% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#2theValue theValue%
\The symbol: #1
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$123%
splitCurrencyâ¬123%
enddocument
Very elegant solution! How does the argument parsing system knowns that he has to split into "text-value" at defsplitCurrencyA#1#2; ?
â Joseph Marie
Aug 16 at 10:15
The currency symbol is only one character or a macro (#1) and the rest until the ; will be the value (#2), thatâÂÂs all.
â Herbert
Aug 16 at 11:36
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
After running DTLifcurrency
or the internal equivalent @dtl@checknumerical
, the currency symbol is stored in @dtl@currency
, so you can use
documentclassarticle
usepackagedatatool
makeatletter
newcommandgetcurrencysymbol[2]%
@dtl@checknumerical#1%
ifnum@dtl@datatype=3relaxlet#2@dtl@currencyelsedef#2??fi
makeatother
newcommandsplitCurrency[1]%
noindent Splitting #1 into its value and symbol parts:
DTLifcurrency#1% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#1theValuetheValue%
\The symbol: getcurrencysymbol#1theCurrencytheCurrency
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$ 123%
enddocument
Anyway to force the extension within getcurrencysymbol, so that I don't have to repeat expandaftertheCurrencyrelax on each use?
â Joseph Marie
Aug 16 at 10:52
@JosephMarie I do not understand your question. Why would you have to repeatexpandaftertheCurrencyrelax
?expandaftertheCurrencyrelax
would try to expand the non-expandablerelax
, soexpandafter
is useless here.
â Marcel Krüger
Aug 16 at 11:05
When I run getcurrencysymbol$ 123symbol% DTLnewdbentrydataSymbolsymbol%, I get an Error (Extra else....). When I do DTLnewdbentrydataSymbolexpandaftersymbolrelax%, there is no error.
â Joseph Marie
Aug 16 at 12:18
2
@JosephMarie that's imho a bug in datatool, it fails if the value starts with something that could be a currency. Your expandafter command hides this. You could also userelaxsymbol
. I wrote Nicola a mail.
â Ulrike Fischer
Aug 16 at 14:28
add a comment |Â
up vote
5
down vote
accepted
After running DTLifcurrency
or the internal equivalent @dtl@checknumerical
, the currency symbol is stored in @dtl@currency
, so you can use
documentclassarticle
usepackagedatatool
makeatletter
newcommandgetcurrencysymbol[2]%
@dtl@checknumerical#1%
ifnum@dtl@datatype=3relaxlet#2@dtl@currencyelsedef#2??fi
makeatother
newcommandsplitCurrency[1]%
noindent Splitting #1 into its value and symbol parts:
DTLifcurrency#1% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#1theValuetheValue%
\The symbol: getcurrencysymbol#1theCurrencytheCurrency
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$ 123%
enddocument
Anyway to force the extension within getcurrencysymbol, so that I don't have to repeat expandaftertheCurrencyrelax on each use?
â Joseph Marie
Aug 16 at 10:52
@JosephMarie I do not understand your question. Why would you have to repeatexpandaftertheCurrencyrelax
?expandaftertheCurrencyrelax
would try to expand the non-expandablerelax
, soexpandafter
is useless here.
â Marcel Krüger
Aug 16 at 11:05
When I run getcurrencysymbol$ 123symbol% DTLnewdbentrydataSymbolsymbol%, I get an Error (Extra else....). When I do DTLnewdbentrydataSymbolexpandaftersymbolrelax%, there is no error.
â Joseph Marie
Aug 16 at 12:18
2
@JosephMarie that's imho a bug in datatool, it fails if the value starts with something that could be a currency. Your expandafter command hides this. You could also userelaxsymbol
. I wrote Nicola a mail.
â Ulrike Fischer
Aug 16 at 14:28
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
After running DTLifcurrency
or the internal equivalent @dtl@checknumerical
, the currency symbol is stored in @dtl@currency
, so you can use
documentclassarticle
usepackagedatatool
makeatletter
newcommandgetcurrencysymbol[2]%
@dtl@checknumerical#1%
ifnum@dtl@datatype=3relaxlet#2@dtl@currencyelsedef#2??fi
makeatother
newcommandsplitCurrency[1]%
noindent Splitting #1 into its value and symbol parts:
DTLifcurrency#1% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#1theValuetheValue%
\The symbol: getcurrencysymbol#1theCurrencytheCurrency
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$ 123%
enddocument
After running DTLifcurrency
or the internal equivalent @dtl@checknumerical
, the currency symbol is stored in @dtl@currency
, so you can use
documentclassarticle
usepackagedatatool
makeatletter
newcommandgetcurrencysymbol[2]%
@dtl@checknumerical#1%
ifnum@dtl@datatype=3relaxlet#2@dtl@currencyelsedef#2??fi
makeatother
newcommandsplitCurrency[1]%
noindent Splitting #1 into its value and symbol parts:
DTLifcurrency#1% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#1theValuetheValue%
\The symbol: getcurrencysymbol#1theCurrencytheCurrency
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$ 123%
enddocument
answered Aug 16 at 9:34
Marcel Krüger
9,9211930
9,9211930
Anyway to force the extension within getcurrencysymbol, so that I don't have to repeat expandaftertheCurrencyrelax on each use?
â Joseph Marie
Aug 16 at 10:52
@JosephMarie I do not understand your question. Why would you have to repeatexpandaftertheCurrencyrelax
?expandaftertheCurrencyrelax
would try to expand the non-expandablerelax
, soexpandafter
is useless here.
â Marcel Krüger
Aug 16 at 11:05
When I run getcurrencysymbol$ 123symbol% DTLnewdbentrydataSymbolsymbol%, I get an Error (Extra else....). When I do DTLnewdbentrydataSymbolexpandaftersymbolrelax%, there is no error.
â Joseph Marie
Aug 16 at 12:18
2
@JosephMarie that's imho a bug in datatool, it fails if the value starts with something that could be a currency. Your expandafter command hides this. You could also userelaxsymbol
. I wrote Nicola a mail.
â Ulrike Fischer
Aug 16 at 14:28
add a comment |Â
Anyway to force the extension within getcurrencysymbol, so that I don't have to repeat expandaftertheCurrencyrelax on each use?
â Joseph Marie
Aug 16 at 10:52
@JosephMarie I do not understand your question. Why would you have to repeatexpandaftertheCurrencyrelax
?expandaftertheCurrencyrelax
would try to expand the non-expandablerelax
, soexpandafter
is useless here.
â Marcel Krüger
Aug 16 at 11:05
When I run getcurrencysymbol$ 123symbol% DTLnewdbentrydataSymbolsymbol%, I get an Error (Extra else....). When I do DTLnewdbentrydataSymbolexpandaftersymbolrelax%, there is no error.
â Joseph Marie
Aug 16 at 12:18
2
@JosephMarie that's imho a bug in datatool, it fails if the value starts with something that could be a currency. Your expandafter command hides this. You could also userelaxsymbol
. I wrote Nicola a mail.
â Ulrike Fischer
Aug 16 at 14:28
Anyway to force the extension within getcurrencysymbol, so that I don't have to repeat expandaftertheCurrencyrelax on each use?
â Joseph Marie
Aug 16 at 10:52
Anyway to force the extension within getcurrencysymbol, so that I don't have to repeat expandaftertheCurrencyrelax on each use?
â Joseph Marie
Aug 16 at 10:52
@JosephMarie I do not understand your question. Why would you have to repeat
expandaftertheCurrencyrelax
? expandaftertheCurrencyrelax
would try to expand the non-expandable relax
, so expandafter
is useless here.â Marcel Krüger
Aug 16 at 11:05
@JosephMarie I do not understand your question. Why would you have to repeat
expandaftertheCurrencyrelax
? expandaftertheCurrencyrelax
would try to expand the non-expandable relax
, so expandafter
is useless here.â Marcel Krüger
Aug 16 at 11:05
When I run getcurrencysymbol$ 123symbol% DTLnewdbentrydataSymbolsymbol%, I get an Error (Extra else....). When I do DTLnewdbentrydataSymbolexpandaftersymbolrelax%, there is no error.
â Joseph Marie
Aug 16 at 12:18
When I run getcurrencysymbol$ 123symbol% DTLnewdbentrydataSymbolsymbol%, I get an Error (Extra else....). When I do DTLnewdbentrydataSymbolexpandaftersymbolrelax%, there is no error.
â Joseph Marie
Aug 16 at 12:18
2
2
@JosephMarie that's imho a bug in datatool, it fails if the value starts with something that could be a currency. Your expandafter command hides this. You could also use
relaxsymbol
. I wrote Nicola a mail.â Ulrike Fischer
Aug 16 at 14:28
@JosephMarie that's imho a bug in datatool, it fails if the value starts with something that could be a currency. Your expandafter command hides this. You could also use
relaxsymbol
. I wrote Nicola a mail.â Ulrike Fischer
Aug 16 at 14:28
add a comment |Â
up vote
5
down vote
documentclassarticle
usepackagedatatool
DTLnewcurrencysymbolâ¬
defsplitCurrency#1noindent Splitting #1 into its value and symbol parts:
splitCurrencyA#1;
defsplitCurrencyA#1#2;%
DTLifcurrency#1#2% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#2theValue theValue%
\The symbol: #1
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$123%
splitCurrencyâ¬123%
enddocument
Very elegant solution! How does the argument parsing system knowns that he has to split into "text-value" at defsplitCurrencyA#1#2; ?
â Joseph Marie
Aug 16 at 10:15
The currency symbol is only one character or a macro (#1) and the rest until the ; will be the value (#2), thatâÂÂs all.
â Herbert
Aug 16 at 11:36
add a comment |Â
up vote
5
down vote
documentclassarticle
usepackagedatatool
DTLnewcurrencysymbolâ¬
defsplitCurrency#1noindent Splitting #1 into its value and symbol parts:
splitCurrencyA#1;
defsplitCurrencyA#1#2;%
DTLifcurrency#1#2% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#2theValue theValue%
\The symbol: #1
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$123%
splitCurrencyâ¬123%
enddocument
Very elegant solution! How does the argument parsing system knowns that he has to split into "text-value" at defsplitCurrencyA#1#2; ?
â Joseph Marie
Aug 16 at 10:15
The currency symbol is only one character or a macro (#1) and the rest until the ; will be the value (#2), thatâÂÂs all.
â Herbert
Aug 16 at 11:36
add a comment |Â
up vote
5
down vote
up vote
5
down vote
documentclassarticle
usepackagedatatool
DTLnewcurrencysymbolâ¬
defsplitCurrency#1noindent Splitting #1 into its value and symbol parts:
splitCurrencyA#1;
defsplitCurrencyA#1#2;%
DTLifcurrency#1#2% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#2theValue theValue%
\The symbol: #1
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$123%
splitCurrencyâ¬123%
enddocument
documentclassarticle
usepackagedatatool
DTLnewcurrencysymbolâ¬
defsplitCurrency#1noindent Splitting #1 into its value and symbol parts:
splitCurrencyA#1;
defsplitCurrencyA#1#2;%
DTLifcurrency#1#2% Check: Is #1 currency?
% Check: #1 is currency !
\The value: DTLconverttodecimal#2theValue theValue%
\The symbol: #1
% Check: #1 is not currency !
Not a currency !
%
begindocument
splitCurrency$123%
splitCurrencyâ¬123%
enddocument
answered Aug 16 at 9:32
Herbert
260k21394702
260k21394702
Very elegant solution! How does the argument parsing system knowns that he has to split into "text-value" at defsplitCurrencyA#1#2; ?
â Joseph Marie
Aug 16 at 10:15
The currency symbol is only one character or a macro (#1) and the rest until the ; will be the value (#2), thatâÂÂs all.
â Herbert
Aug 16 at 11:36
add a comment |Â
Very elegant solution! How does the argument parsing system knowns that he has to split into "text-value" at defsplitCurrencyA#1#2; ?
â Joseph Marie
Aug 16 at 10:15
The currency symbol is only one character or a macro (#1) and the rest until the ; will be the value (#2), thatâÂÂs all.
â Herbert
Aug 16 at 11:36
Very elegant solution! How does the argument parsing system knowns that he has to split into "text-value" at defsplitCurrencyA#1#2; ?
â Joseph Marie
Aug 16 at 10:15
Very elegant solution! How does the argument parsing system knowns that he has to split into "text-value" at defsplitCurrencyA#1#2; ?
â Joseph Marie
Aug 16 at 10:15
The currency symbol is only one character or a macro (#1) and the rest until the ; will be the value (#2), thatâÂÂs all.
â Herbert
Aug 16 at 11:36
The currency symbol is only one character or a macro (#1) and the rest until the ; will be the value (#2), thatâÂÂs all.
â Herbert
Aug 16 at 11:36
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f446257%2fhow-to-extract-the-currency-symbol%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password