PDA

View Full Version : removing comma from order total


duvys
03-31-06, 06:04 PM
I am trying to add the order total to a conversion tracker on the invoice page and I don't want it to include anything other than the numeric value. I have always used
%EXPR(substring('%order_total%', 2, 9))%
which displays as 1,234.56, but the tracking I am currently using doesn't want a comma in there either. How can I call the order total without the comma?

Thanks.

Vic - WolfPaw Computers
03-31-06, 06:24 PM
You could add one more step:

%ASSIGN(g.myvar|%EXPR(glosub(%EXPR(substring('%ord er_total%', 2, 9))%,',',''))%

If that is a little confusing...

What we're doing is taking the expression substring('%order_total%', 2, 9) and running it through the glosub (global search/replace) operator, and replacing all instances of ',' with ''.

Might need some tweaking. I didnt test it.

truXoft
03-31-06, 07:01 PM
Instead of it, I'd suggest using the plain variable Orders.d.total without any additional gimmicks - it contains the numerical value unformatted

Vic - WolfPaw Computers
03-31-06, 07:17 PM
Thanks Ivo.

Sometimes you cannot see the forest through the trees!

%VAR(Orders.d.total)%

Doh!

duvys
03-31-06, 07:51 PM
lol.

Thanks!