Avatar

Level 1

Hi,

 

First post, new to the platform so hoping so clever people can point me in the right direction! I'm trying to set up a personalisation block so I can convert a variable - but I'm struggling!

 

I have an XML string, I'm trying to extract a cost value (e.g. £1,509.10) from the string convert into a number (1,509.10), so I can subtract 10 from it). Any idea how to do this.

 

I've got as far as defining a variable for the XML string in the email - and I can pull out the variable and get rid of the £ sign with something like;

 

<%= escapeXmlStr(ctx.messageMetadata.MainCost.CostAmount).substr(1,10)%>

 

I'm stuck beyond this - any help appreciated.