I have a survey with programmatically generated questions, and I want to display nicely formatted numbers to participants. Do you know of a way to do this?
Here's an example
Desired output
Tom gave Jerry $500
Tom gave Jerry $100
Tom gave Jerry $50,000
Tom gave Jerry $10,000
Current output
Tom gave Jerry $500
Tom gave Jerry $100
Tom gave Jerry $50000
Tom gave Jerry $10000
Current input
>> numbers = [1000, 100000]
>> ratios = [0.5, 0.1]
>> questions = []
*for: n in numbers
*for: r in ratios
>> questions.add([n*r])
*for: q in questions
Tom gave Jerry *${q}*
Thank you!
So far, I have tried using the .text
method, and also tried generating a collection
object that iterates through the text of the number, adding commas (but then I can't convert it back to a string)