The FormatNumber function can convert decimal to hex but how do I convert from hex back to decimal? It doesn't work and breaks with error:
An error occurred when attempting to evaluate a FormatNumber function call. The input value (7D29896) 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: 7D29896 Format: D
Code:
%%[
@VAR myNum
SET @myNum = 131242134
SET @Hex = FormatNumber(@myNum, "X")
SET @Decimal = FormatNumber(@Hex, "D") /* breaks on this call */
]%%
Original: %%=v(@myNum)=%%
HEX: %%=v(@Hex)=%%
DEC: %%=v(@Decimal)=%%
@myNum
? It'd help to know what you're trying to accomplish.set @num = FF
it won't work. Then if you doset @num = "FF"
it is not a numeric type any longer -> you cannot use FormatNumber because it requires a numeric. Do you have a plan for that? ;)