Validation to Custom Script

Can I add currency validation to a custom script and/or a hidden value?

I’m having an issue that some of my questions have a currency validation on them, but my custom script and subsequent hidden values are not picking up the currency validation and only returning a number?

If I understand you correctly, the problem is that the default value for (d) is not being shown as a currency value?

The default value will be whatever is stored in your hidden value field (c). Hidden Values are all strings. You may just want to use the php function money_format ( http://php.net/manual/en/function.money-format.php ) to convert your total before storing it in your hidden value field. Something like:

%%currencytotal = money_format(‘%.2n’, %%total);

Note that this forum converts straight quotes to left- and right-quotes which won’t work in your code. If you copy and paste my example code, you will need to replace the quote characters.

I also have this question. I want to subtract one currency value from another and display the total using custom scripting. When I use number format it works fine, but when I switch to currency “0” is returned. Is there a workaround to this?