Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Format answer option as currency

Hi. I have a select (and later a grid question) in which I ask the respondents if they are willing to pay a certain amount for a product. The price which is shown, is based on a previous answer, plus a markup. Therefore, there is a calculation in the answer options. However, some of the calculations result in: e.g. €17.5. Is there a way to automatically format this text as having to decimals (i.e. €17.50).
An example of one of the answer possibilities:
[% (15 / GetValue(Question1)) + 5 %]
asked Jul 31, 2018 by Marten

1 Answer

0 votes
Sawtooth Script has a FormatNumber function that can be used to force a number to display with a specific number of digits.  Try this:

€[% FormatNumber(15 / GetValue(Question1) + 5, ",", ".", 2) %]
answered Jul 31, 2018 by Zachary Platinum Sawtooth Software, Inc. (121,525 points)