﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 7  » Add comma(s) to randomly generated number</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Mon, 23 Nov 2026 23:18:45 GMT</lastBuildDate><ttl>20</ttl><item><title>Add comma(s) to randomly generated number</title><link>https://forums.millisecond.com/Topic41631.aspx</link><description>I would like to display text that includes a random number between 10000 and 50000, but for the text to include the commas so that it reads as "10,000 followers" and "50,000 followers". &lt;br/&gt;&lt;br/&gt;This is what I currently have: &lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;% round(rand(10000, 50000)) %&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;Thanks!</description><pubDate>Wed, 10 Sep 2025 14:29:59 GMT</pubDate><dc:creator>wmfang</dc:creator></item><item><title>RE: Add comma(s) to randomly generated number</title><link>https://forums.millisecond.com/Topic41638.aspx</link><description>&lt;blockquote data-id="41637" class="if-quote-wrapper" unselectable="on" data-guid="1757514367500" contenteditable="false" id="if_insertedNode_1757514366945"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41637" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41637" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41637" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41637"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41636" class="if-quote-wrapper" unselectable="on" data-guid="1757514367500" contenteditable="false" id="if_insertedNode_1757514263541"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41636" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41636" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41636" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41636"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41635" class="if-quote-wrapper" unselectable="on" data-guid="1757514367500" contenteditable="false" id="if_insertedNode_1757514046534"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41635" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41635" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41635" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41635"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41634" class="if-quote-wrapper" unselectable="on" data-guid="1757514367500" contenteditable="false" id="if_insertedNode_1757513892774"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41634" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41634" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41634" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41634"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41633" class="if-quote-wrapper" unselectable="on" data-guid="1757514367500" contenteditable="false" id="if_insertedNode_1757513495411"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41633" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41633" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41633" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41633"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41632" class="if-quote-wrapper" unselectable="on" data-guid="1757514367500" contenteditable="false" id="if_insertedNode_1757513196639"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41632" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41632" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41632" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41632"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41631" class="if-quote-wrapper" unselectable="on" data-guid="1757514367500" contenteditable="false" id="if_insertedNode_1757468210815"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41631" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41631" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41631" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/9/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41631"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I would like to display text that includes a random number between 10000 and 50000, but for the text to include the commas so that it reads as "10,000 followers" and "50,000 followers". &lt;br/&gt;&lt;br/&gt;This is what I currently have: &lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;% round(rand(10000, 50000)) %&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;Thanks!&lt;a class="if-quote-goto quote-link" href="#" data-id="41631"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;[code]&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = null&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial exampleTrial&amp;gt;&lt;br/&gt;/ onTrialBegin = {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.nFollowers = round(rand(10000, 50000));&lt;br/&gt;}&lt;br/&gt;/ stimulusFrames = [1=followersText]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;&amp;lt;/trial&amp;gt;[/code]&lt;a class="if-quote-goto quote-link" href="#" data-id="41632"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Would this also work? Why does values need to first be null? Thanks!&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = round(rand(10000, 50000));&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage high_social_ID&amp;gt;&lt;br/&gt;/ questions = [1=backgroundImage_ID_1; 2=profileImage; 3=slider_bar_social_1]&lt;br/&gt;/ stimulusframes = [&lt;br/&gt;1=background_outer; &lt;br/&gt;2=background; &lt;br/&gt;3=nameImage; &lt;br/&gt;4=followersText; &lt;br/&gt;5=connectionsText_high; &lt;br/&gt;6=locationText_ID; &lt;br/&gt;7=dot_high]&lt;br/&gt;/ nextlabel = "Next"&lt;br/&gt;/ showpagenumbers = false&lt;br/&gt;/ recorddata = true&lt;br/&gt;/ navigationbuttonfontstyle = ("Arial", 12pt, false)&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block socialONLY&amp;gt;&lt;br/&gt;/ trials = [&lt;br/&gt;1-8=noreplacenorepeat(&lt;br/&gt;high_social_AR,&lt;br/&gt;high_social_SC,&lt;br/&gt;high_social_TN,&lt;br/&gt;high_social_ID,&lt;br/&gt;low_social_AR,&lt;br/&gt;low_social_SC,&lt;br/&gt;low_social_TN,&lt;br/&gt;low_social_ID)&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41633"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You can do this, if you don't want the value (a variable) to ever change. Then the round(rand()) expression is evaluated a single time when the script is parsted, and whatever the result is the value the variable will have. Usually, however, you'll want variables to change in specific ways at speciffic times, so you initialize (see below) and set it to whatever you need later.&lt;br/&gt;&lt;br/&gt;&amp;gt; Why does values need to first be null?&lt;br/&gt;&lt;br/&gt;It doesn't have to. It's a normal way to initialize a variable whose value is to be determined later.&lt;a class="if-quote-goto quote-link" href="#" data-id="41634"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Got it. Thanks! How do I make it so that the value changes with each surveypage?&lt;a class="if-quote-goto quote-link" href="#" data-id="41635"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You set the value to a new one /onTrialBegin in the &amp;lt;surveypage&amp;gt;, just like I showed in the example code I gave you.&lt;a class="if-quote-goto quote-link" href="#" data-id="41636"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;How do I make it so that the &amp;lt;data&amp;gt; stores the value for each surveypage in a column? Thanks so much&lt;a class="if-quote-goto quote-link" href="#" data-id="41637"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;First, you need to run your surveypages via blocks, not survey elements.&lt;br/&gt;&lt;br/&gt;Second, you define a data element with everything you want logged, and you include the variable as a column there.&lt;br/&gt;&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/current/html/language/attributes/columns.htm"&gt;https://www.millisecond.com/support/docs/current/html/language/attributes/columns.htm&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;More generally, you may benefit from working through the Programmer's Manual:&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/Inquisit%20Programmer's%20Manual.pdf"&gt;https://www.millisecond.com/support/Inquisit%20Programmer's%20Manual.pdf&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 10 Sep 2025 14:29:59 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Add comma(s) to randomly generated number</title><link>https://forums.millisecond.com/Topic41637.aspx</link><description>&lt;blockquote data-id="41636" class="if-quote-wrapper" unselectable="on" data-guid="1757514264137" contenteditable="false" id="if_insertedNode_1757514263541"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41636" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41636" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41636" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41636"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41635" class="if-quote-wrapper" unselectable="on" data-guid="1757514264137" contenteditable="false" id="if_insertedNode_1757514046534"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41635" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41635" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41635" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41635"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41634" class="if-quote-wrapper" unselectable="on" data-guid="1757514264137" contenteditable="false" id="if_insertedNode_1757513892774"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41634" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41634" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41634" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41634"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41633" class="if-quote-wrapper" unselectable="on" data-guid="1757514264137" contenteditable="false" id="if_insertedNode_1757513495411"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41633" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41633" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41633" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41633"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41632" class="if-quote-wrapper" unselectable="on" data-guid="1757514264137" contenteditable="false" id="if_insertedNode_1757513196639"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41632" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41632" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41632" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41632"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41631" class="if-quote-wrapper" unselectable="on" data-guid="1757514264137" contenteditable="false" id="if_insertedNode_1757468210815"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41631" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41631" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41631" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/9/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41631"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I would like to display text that includes a random number between 10000 and 50000, but for the text to include the commas so that it reads as "10,000 followers" and "50,000 followers". &lt;br/&gt;&lt;br/&gt;This is what I currently have: &lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;% round(rand(10000, 50000)) %&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;Thanks!&lt;a class="if-quote-goto quote-link" href="#" data-id="41631"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;[code]&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = null&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial exampleTrial&amp;gt;&lt;br/&gt;/ onTrialBegin = {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.nFollowers = round(rand(10000, 50000));&lt;br/&gt;}&lt;br/&gt;/ stimulusFrames = [1=followersText]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;&amp;lt;/trial&amp;gt;[/code]&lt;a class="if-quote-goto quote-link" href="#" data-id="41632"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Would this also work? Why does values need to first be null? Thanks!&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = round(rand(10000, 50000));&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage high_social_ID&amp;gt;&lt;br/&gt;/ questions = [1=backgroundImage_ID_1; 2=profileImage; 3=slider_bar_social_1]&lt;br/&gt;/ stimulusframes = [&lt;br/&gt;1=background_outer; &lt;br/&gt;2=background; &lt;br/&gt;3=nameImage; &lt;br/&gt;4=followersText; &lt;br/&gt;5=connectionsText_high; &lt;br/&gt;6=locationText_ID; &lt;br/&gt;7=dot_high]&lt;br/&gt;/ nextlabel = "Next"&lt;br/&gt;/ showpagenumbers = false&lt;br/&gt;/ recorddata = true&lt;br/&gt;/ navigationbuttonfontstyle = ("Arial", 12pt, false)&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block socialONLY&amp;gt;&lt;br/&gt;/ trials = [&lt;br/&gt;1-8=noreplacenorepeat(&lt;br/&gt;high_social_AR,&lt;br/&gt;high_social_SC,&lt;br/&gt;high_social_TN,&lt;br/&gt;high_social_ID,&lt;br/&gt;low_social_AR,&lt;br/&gt;low_social_SC,&lt;br/&gt;low_social_TN,&lt;br/&gt;low_social_ID)&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41633"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You can do this, if you don't want the value (a variable) to ever change. Then the round(rand()) expression is evaluated a single time when the script is parsted, and whatever the result is the value the variable will have. Usually, however, you'll want variables to change in specific ways at speciffic times, so you initialize (see below) and set it to whatever you need later.&lt;br/&gt;&lt;br/&gt;&amp;gt; Why does values need to first be null?&lt;br/&gt;&lt;br/&gt;It doesn't have to. It's a normal way to initialize a variable whose value is to be determined later.&lt;a class="if-quote-goto quote-link" href="#" data-id="41634"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Got it. Thanks! How do I make it so that the value changes with each surveypage?&lt;a class="if-quote-goto quote-link" href="#" data-id="41635"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You set the value to a new one /onTrialBegin in the &amp;lt;surveypage&amp;gt;, just like I showed in the example code I gave you.&lt;a class="if-quote-goto quote-link" href="#" data-id="41636"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;How do I make it so that the &amp;lt;data&amp;gt; stores the value for each surveypage in a column? Thanks so much</description><pubDate>Wed, 10 Sep 2025 14:25:36 GMT</pubDate><dc:creator>wmfang</dc:creator></item><item><title>RE: Add comma(s) to randomly generated number</title><link>https://forums.millisecond.com/Topic41636.aspx</link><description>&lt;blockquote data-id="41635" class="if-quote-wrapper" unselectable="on" data-guid="1757514047680" contenteditable="false" id="if_insertedNode_1757514046534"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41635" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41635" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41635" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41635"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41634" class="if-quote-wrapper" unselectable="on" data-guid="1757514047680" contenteditable="false" id="if_insertedNode_1757513892774"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41634" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41634" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41634" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41634"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41633" class="if-quote-wrapper" unselectable="on" data-guid="1757514047680" contenteditable="false" id="if_insertedNode_1757513495411"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41633" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41633" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41633" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41633"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41632" class="if-quote-wrapper" unselectable="on" data-guid="1757514047680" contenteditable="false" id="if_insertedNode_1757513196639"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41632" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41632" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41632" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41632"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41631" class="if-quote-wrapper" unselectable="on" data-guid="1757514047680" contenteditable="false" id="if_insertedNode_1757468210815"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41631" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41631" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41631" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/9/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41631"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I would like to display text that includes a random number between 10000 and 50000, but for the text to include the commas so that it reads as "10,000 followers" and "50,000 followers". &lt;br/&gt;&lt;br/&gt;This is what I currently have: &lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;% round(rand(10000, 50000)) %&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;Thanks!&lt;a class="if-quote-goto quote-link" href="#" data-id="41631"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;[code]&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = null&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial exampleTrial&amp;gt;&lt;br/&gt;/ onTrialBegin = {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.nFollowers = round(rand(10000, 50000));&lt;br/&gt;}&lt;br/&gt;/ stimulusFrames = [1=followersText]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;&amp;lt;/trial&amp;gt;[/code]&lt;a class="if-quote-goto quote-link" href="#" data-id="41632"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Would this also work? Why does values need to first be null? Thanks!&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = round(rand(10000, 50000));&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage high_social_ID&amp;gt;&lt;br/&gt;/ questions = [1=backgroundImage_ID_1; 2=profileImage; 3=slider_bar_social_1]&lt;br/&gt;/ stimulusframes = [&lt;br/&gt;1=background_outer; &lt;br/&gt;2=background; &lt;br/&gt;3=nameImage; &lt;br/&gt;4=followersText; &lt;br/&gt;5=connectionsText_high; &lt;br/&gt;6=locationText_ID; &lt;br/&gt;7=dot_high]&lt;br/&gt;/ nextlabel = "Next"&lt;br/&gt;/ showpagenumbers = false&lt;br/&gt;/ recorddata = true&lt;br/&gt;/ navigationbuttonfontstyle = ("Arial", 12pt, false)&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block socialONLY&amp;gt;&lt;br/&gt;/ trials = [&lt;br/&gt;1-8=noreplacenorepeat(&lt;br/&gt;high_social_AR,&lt;br/&gt;high_social_SC,&lt;br/&gt;high_social_TN,&lt;br/&gt;high_social_ID,&lt;br/&gt;low_social_AR,&lt;br/&gt;low_social_SC,&lt;br/&gt;low_social_TN,&lt;br/&gt;low_social_ID)&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41633"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You can do this, if you don't want the value (a variable) to ever change. Then the round(rand()) expression is evaluated a single time when the script is parsted, and whatever the result is the value the variable will have. Usually, however, you'll want variables to change in specific ways at speciffic times, so you initialize (see below) and set it to whatever you need later.&lt;br/&gt;&lt;br/&gt;&amp;gt; Why does values need to first be null?&lt;br/&gt;&lt;br/&gt;It doesn't have to. It's a normal way to initialize a variable whose value is to be determined later.&lt;a class="if-quote-goto quote-link" href="#" data-id="41634"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Got it. Thanks! How do I make it so that the value changes with each surveypage?&lt;a class="if-quote-goto quote-link" href="#" data-id="41635"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You set the value to a new one /onTrialBegin in the &amp;lt;surveypage&amp;gt;, just like I showed in the example code I gave you.</description><pubDate>Wed, 10 Sep 2025 14:21:29 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Add comma(s) to randomly generated number</title><link>https://forums.millisecond.com/Topic41635.aspx</link><description>&lt;blockquote data-id="41634" class="if-quote-wrapper" unselectable="on" data-guid="1757513893274" contenteditable="false" id="if_insertedNode_1757513892774"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41634" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41634" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41634" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41634"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41633" class="if-quote-wrapper" unselectable="on" data-guid="1757513893274" contenteditable="false" id="if_insertedNode_1757513495411"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41633" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41633" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41633" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41633"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41632" class="if-quote-wrapper" unselectable="on" data-guid="1757513893274" contenteditable="false" id="if_insertedNode_1757513196639"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41632" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41632" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41632" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41632"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41631" class="if-quote-wrapper" unselectable="on" data-guid="1757513893274" contenteditable="false" id="if_insertedNode_1757468210815"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41631" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41631" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41631" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/9/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41631"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I would like to display text that includes a random number between 10000 and 50000, but for the text to include the commas so that it reads as "10,000 followers" and "50,000 followers". &lt;br/&gt;&lt;br/&gt;This is what I currently have: &lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;% round(rand(10000, 50000)) %&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;Thanks!&lt;a class="if-quote-goto quote-link" href="#" data-id="41631"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;[code]&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = null&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial exampleTrial&amp;gt;&lt;br/&gt;/ onTrialBegin = {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.nFollowers = round(rand(10000, 50000));&lt;br/&gt;}&lt;br/&gt;/ stimulusFrames = [1=followersText]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;&amp;lt;/trial&amp;gt;[/code]&lt;a class="if-quote-goto quote-link" href="#" data-id="41632"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Would this also work? Why does values need to first be null? Thanks!&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = round(rand(10000, 50000));&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage high_social_ID&amp;gt;&lt;br/&gt;/ questions = [1=backgroundImage_ID_1; 2=profileImage; 3=slider_bar_social_1]&lt;br/&gt;/ stimulusframes = [&lt;br/&gt;1=background_outer; &lt;br/&gt;2=background; &lt;br/&gt;3=nameImage; &lt;br/&gt;4=followersText; &lt;br/&gt;5=connectionsText_high; &lt;br/&gt;6=locationText_ID; &lt;br/&gt;7=dot_high]&lt;br/&gt;/ nextlabel = "Next"&lt;br/&gt;/ showpagenumbers = false&lt;br/&gt;/ recorddata = true&lt;br/&gt;/ navigationbuttonfontstyle = ("Arial", 12pt, false)&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block socialONLY&amp;gt;&lt;br/&gt;/ trials = [&lt;br/&gt;1-8=noreplacenorepeat(&lt;br/&gt;high_social_AR,&lt;br/&gt;high_social_SC,&lt;br/&gt;high_social_TN,&lt;br/&gt;high_social_ID,&lt;br/&gt;low_social_AR,&lt;br/&gt;low_social_SC,&lt;br/&gt;low_social_TN,&lt;br/&gt;low_social_ID)&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41633"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You can do this, if you don't want the value (a variable) to ever change. Then the round(rand()) expression is evaluated a single time when the script is parsted, and whatever the result is the value the variable will have. Usually, however, you'll want variables to change in specific ways at speciffic times, so you initialize (see below) and set it to whatever you need later.&lt;br/&gt;&lt;br/&gt;&amp;gt; Why does values need to first be null?&lt;br/&gt;&lt;br/&gt;It doesn't have to. It's a normal way to initialize a variable whose value is to be determined later.&lt;a class="if-quote-goto quote-link" href="#" data-id="41634"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Got it. Thanks! How do I make it so that the value changes with each surveypage?</description><pubDate>Wed, 10 Sep 2025 14:20:06 GMT</pubDate><dc:creator>wmfang</dc:creator></item><item><title>RE: Add comma(s) to randomly generated number</title><link>https://forums.millisecond.com/Topic41634.aspx</link><description>&lt;blockquote data-id="41633" class="if-quote-wrapper" unselectable="on" data-guid="1757513496542" contenteditable="false" id="if_insertedNode_1757513495411"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41633" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41633" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41633" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41633"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41632" class="if-quote-wrapper" unselectable="on" data-guid="1757513496542" contenteditable="false" id="if_insertedNode_1757513196639"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41632" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41632" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41632" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41632"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41631" class="if-quote-wrapper" unselectable="on" data-guid="1757513496542" contenteditable="false" id="if_insertedNode_1757468210815"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41631" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41631" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41631" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/9/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41631"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I would like to display text that includes a random number between 10000 and 50000, but for the text to include the commas so that it reads as "10,000 followers" and "50,000 followers". &lt;br/&gt;&lt;br/&gt;This is what I currently have: &lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;% round(rand(10000, 50000)) %&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;Thanks!&lt;a class="if-quote-goto quote-link" href="#" data-id="41631"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;[code]&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = null&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial exampleTrial&amp;gt;&lt;br/&gt;/ onTrialBegin = {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.nFollowers = round(rand(10000, 50000));&lt;br/&gt;}&lt;br/&gt;/ stimulusFrames = [1=followersText]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;&amp;lt;/trial&amp;gt;[/code]&lt;a class="if-quote-goto quote-link" href="#" data-id="41632"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Would this also work? Why does values need to first be null? Thanks!&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = round(rand(10000, 50000));&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage high_social_ID&amp;gt;&lt;br/&gt;/ questions = [1=backgroundImage_ID_1; 2=profileImage; 3=slider_bar_social_1]&lt;br/&gt;/ stimulusframes = [&lt;br/&gt;1=background_outer; &lt;br/&gt;2=background; &lt;br/&gt;3=nameImage; &lt;br/&gt;4=followersText; &lt;br/&gt;5=connectionsText_high; &lt;br/&gt;6=locationText_ID; &lt;br/&gt;7=dot_high]&lt;br/&gt;/ nextlabel = "Next"&lt;br/&gt;/ showpagenumbers = false&lt;br/&gt;/ recorddata = true&lt;br/&gt;/ navigationbuttonfontstyle = ("Arial", 12pt, false)&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block socialONLY&amp;gt;&lt;br/&gt;/ trials = [&lt;br/&gt;1-8=noreplacenorepeat(&lt;br/&gt;high_social_AR,&lt;br/&gt;high_social_SC,&lt;br/&gt;high_social_TN,&lt;br/&gt;high_social_ID,&lt;br/&gt;low_social_AR,&lt;br/&gt;low_social_SC,&lt;br/&gt;low_social_TN,&lt;br/&gt;low_social_ID)&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41633"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You can do this, if you don't want the value (a variable) to ever change. Then the round(rand()) expression is evaluated a single time when the script is parsted, and whatever the result is the value the variable will have. Usually, however, you'll want variables to change in specific ways at speciffic times, so you initialize (see below) and set it to whatever you need later.&lt;br/&gt;&lt;br/&gt;&amp;gt; Why does values need to first be null?&lt;br/&gt;&lt;br/&gt;It doesn't have to. It's a normal way to initialize a variable whose value is to be determined later.</description><pubDate>Wed, 10 Sep 2025 14:15:16 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Add comma(s) to randomly generated number</title><link>https://forums.millisecond.com/Topic41633.aspx</link><description>&lt;blockquote data-id="41632" class="if-quote-wrapper" unselectable="on" data-guid="1757513197878" contenteditable="false" id="if_insertedNode_1757513196639"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41632" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41632" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41632" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/10/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41632"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41631" class="if-quote-wrapper" unselectable="on" data-guid="1757513197878" contenteditable="false" id="if_insertedNode_1757468210815"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41631" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41631" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41631" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/9/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41631"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I would like to display text that includes a random number between 10000 and 50000, but for the text to include the commas so that it reads as "10,000 followers" and "50,000 followers". &lt;br/&gt;&lt;br/&gt;This is what I currently have: &lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;% round(rand(10000, 50000)) %&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;Thanks!&lt;a class="if-quote-goto quote-link" href="#" data-id="41631"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;[code]&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = null&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial exampleTrial&amp;gt;&lt;br/&gt;/ onTrialBegin = {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.nFollowers = round(rand(10000, 50000));&lt;br/&gt;}&lt;br/&gt;/ stimulusFrames = [1=followersText]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;&amp;lt;/trial&amp;gt;[/code]&lt;a class="if-quote-goto quote-link" href="#" data-id="41632"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Would this also work? Why does values need to first be null? Thanks!&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = round(rand(10000, 50000));&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage high_social_ID&amp;gt;&lt;br/&gt;/ questions = [1=backgroundImage_ID_1; 2=profileImage; 3=slider_bar_social_1]&lt;br/&gt;/ stimulusframes = [&lt;br/&gt;1=background_outer; &lt;br/&gt;2=background; &lt;br/&gt;3=nameImage; &lt;br/&gt;4=followersText; &lt;br/&gt;5=connectionsText_high; &lt;br/&gt;6=locationText_ID; &lt;br/&gt;7=dot_high]&lt;br/&gt;/ nextlabel = "Next"&lt;br/&gt;/ showpagenumbers = false&lt;br/&gt;/ recorddata = true&lt;br/&gt;/ navigationbuttonfontstyle = ("Arial", 12pt, false)&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block socialONLY&amp;gt;&lt;br/&gt;/ trials = [&lt;br/&gt;1-8=noreplacenorepeat(&lt;br/&gt;high_social_AR,&lt;br/&gt;high_social_SC,&lt;br/&gt;high_social_TN,&lt;br/&gt;high_social_ID,&lt;br/&gt;low_social_AR,&lt;br/&gt;low_social_SC,&lt;br/&gt;low_social_TN,&lt;br/&gt;low_social_ID)&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 10 Sep 2025 14:08:09 GMT</pubDate><dc:creator>wmfang</dc:creator></item><item><title>RE: Add comma(s) to randomly generated number</title><link>https://forums.millisecond.com/Topic41632.aspx</link><description>&lt;blockquote data-id="41631" class="if-quote-wrapper" unselectable="on" data-guid="1757468211469" contenteditable="false" id="if_insertedNode_1757468210815"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41631" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41631" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41631" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;wmfang - 9/9/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41631"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I would like to display text that includes a random number between 10000 and 50000, but for the text to include the commas so that it reads as "10,000 followers" and "50,000 followers". &lt;br/&gt;&lt;br/&gt;This is what I currently have: &lt;br/&gt;&lt;br/&gt;&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;% round(rand(10000, 50000)) %&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;Thanks!&lt;a class="if-quote-goto quote-link" href="#" data-id="41631"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;[code]&amp;lt;text followersText&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%subString(values.nFollowers, 0, 2)%&amp;gt;,&amp;lt;%subString(values.nFollowers, 2, 3)%&amp;gt; followers")&lt;br/&gt;/ position = (20%, 65%)&lt;br/&gt;/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 0)&lt;br/&gt;/ color = steelblue&lt;br/&gt;/ halign = left&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nFollowers = null&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial exampleTrial&amp;gt;&lt;br/&gt;/ onTrialBegin = {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.nFollowers = round(rand(10000, 50000));&lt;br/&gt;}&lt;br/&gt;/ stimulusFrames = [1=followersText]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;&amp;lt;/trial&amp;gt;[/code]</description><pubDate>Wed, 10 Sep 2025 01:37:07 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>