Question: I am using AMPScript to insert values into salesforce custom object. Inserting String values is working fine but for salesforce data type Currency(16,2) I am getting error. I have tried FormatCurrency function without any luck.

```
%%[

var @p_cost , @insertthis

set @p_cost = [product cost]
set @p_cost =  FormatCurrency(@p_cost,"en_GB", 2) 

set @insertthis = CreateSalesforceObject("myObject__c", 1, "p_cost__c", @p_cost)

]%%

```

Anybody have any idea?

Kind Regards,

Answer: 
When passing currency data using the CreateSalesforceObject() or UpdateSingleSalesforceObject() **AMPScript** functions, the currency value must be passed as a number. The appropriate currency symbol to use is manages in the Salesforce ORG settings. You can manage the default default currency for an ORG by going to: setup / Company Profile / Company Information and edit the Currency Locale field. 

While testing the **AMPScript** functions, I was able to successfully pass the following values in a currency field.

```
set @p_cost = 12.40
set @p_cost = "12.40"
set @p_cost = "12.40555"
set @p_cost = 12.40555

```

However, the below values caused the **AMPScript** function to fail.

```
set @p_cost = FormatCurrency(@p_cost,"en_GB", 2) 
set @p_cost = £12.40
set @p_cost = "£12.40"
set @p_cost = "$12.40"

```
As my original data coming from salesforce itself as Currency and saved in marketing cloud as decimal. 

I have used FormatNumber function to convert to number and it saved back to Salesforce object perfectly.

```
set @p_cost = FormatNumber(@p_cost,"N2")

```

Thanks all those who helped to solve this issue.