Quantcast
Channel: Active questions tagged ampscript - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 359

AMPscript formatting a number using a variable that needs TreatAsContent

$
0
0

I have a data extension that gives me a user's currency, plus fields for the cost that look like this:

cost_USD | cost_EUR | cost_BRL

Here's what I have in my ampscript:

Set @partner_currency = partner_currencySet @advertiser_email = advertiser_emailSet @variable_name = Concat('%%cost_',@partner_currency,'%%')

and within the body of the email:

%%=TreatAsContent(@variable_name)=%%

This works perfectly to retrieve the data under the cost_xxx fields, which are all numbers. However, I need to format each number according to the country as well.

I'm trying to format them using %%=FormatNumber(@variable_name,"N2","en-US")=%% but of course since @variable_name needs the "TreatAsContent" to return the number and not the string name of the variable name, the formatting isn't working.

Is there a way around this?


Viewing all articles
Browse latest Browse all 359

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>