Have an idea?

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

Format a number from a pass-in field

Hi there,

I have a survey where some information about a price is passed in to our survey using a pass-in field.

It's a number so is easy to display in later questions using £[% price %] - but I'm just wondering if there is a way to format it so if the value of price is >=1000 it will add in a comma separator - so £1,000 rather than £1000 etc.

Wondering if it's something I need to use some Perl code for?

Thanks
Ali
asked Nov 22 by Ali

1 Answer

+1 vote
The Sawtooth Script function FormatNumber was made just for this.  Try this out:

[% FormatNumber(price, ",", ".", 0) %]
answered Nov 22 by Zachary Platinum Sawtooth Software, Inc. (188,925 points)
Thanks very much - that works perfectly!
...