1

I'm using the following piece of ampscript:

FormatNumber(@BillAmount,'F0','en-US')

Occasionally, a non-numeric piece of data is added to the @BillAmount (assumption, not 100% sure yet). When this happens, the the whole journey stops due to the following error:

ExactTarget.OMM.FunctionExecutionException: An error occurred when attempting to evaluate a FormatNumber function call. The input value () cannot be formatted as a number. The first parameter value for a FormatNumber call must be a numeric type supported by the requested format.
Value: 
Format: F0
Error Code: OMM_FUNC_EXEC_ERROR@
- from OMMCommon

Assuming I can't fix the bad data coming in, is there a way I can structure the ampscript to skip this if the data isn't numeric? Trying to fix this so the whole journey doesn't conk out in this edge case.

Any advice?

2

You could also do it inline:

%%=iif(empty(@billAmount),'0.00', FormatNumber(@BillAmount,'F0','en-US'))=%%

Reference:

0

I think I figured it out. It was due an empty value. I excluded those with with an if statement. Not elegant, but it seems to have worked.

%%[if NOT EMPTY(@BillAmount) then]%%

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.