+xI had originally inserted the format functions in those sections of the code as I was having the problem described in
https://www.millisecond.com/forums/Topic25399.aspx and needed more rounded numbers to be saved for our purposes with the output
I can remove them there, however if possible I would still like the values to be printed rounded to exactly 2 decimal places as they represent dollars and cents. I've tried putting the format function in a range of other locations (e.g. in the <text> element, in an <expression>) but so long as it is somewhere in the path from the participant's slider response to the ultimate text element, the value is printed as 0.00 if the default slider response is used without clicking and dragging the slider
I see. Best then to treat the default case separately:
<surveypage known_practice_page>
/ stimulustimes = [0 = practice_known_pics, urncontents_label, practice_knownodds, quittext, practiceheader]
/ questions = [1 = slider.bet_slider]
/ showpagenumbers = false
/ showquestionnumbers = false
/ nextbuttonposition = (40%, 90%)
/ finishlabel = "Place bet"
/ navigationbuttonsize = (20%, 6%)
/ navigationbuttonfontstyle = ("Arial", 3.33%, false, false, false, false, 5, 1)
/ ontrialend = [values.practice_known60bet = format("%.2f", slider.bet_slider.response/100)]
/ ontrialend = [
if (slider.bet_slider.response == "500") values.practice_known60bet = "5.00";
]</surveypage>
<surveypage unknown_practice_page>
/ stimulustimes = [0 = practice_unknown_pics, urncontents_label, practice_unknownodds, quittext, practiceheader]
/ questions = [1 = slider.bet_slider]
/ showpagenumbers = false
/ showquestionnumbers = false
/ nextbuttonposition = (40%, 90%)
/ finishlabel = "Place bet"
/ navigationbuttonsize = (20%, 6%)
/ navigationbuttonfontstyle = ("Arial", 3.33%, false, false, false, false, 5, 1)
/ ontrialend = [values.practice_unknown40bet = format("%.2f", slider.bet_slider.response/100)]
/ ontrialend = [
if (slider.bet_slider.response == "500") values.practice_unknown40bet = "5.00";
]</surveypage>
and
<surveypage known_urn_page>
/ stimulustimes = [0 = known_urn_pics, urncontents_label, knownodds, quittext, maintask_header]
/ questions = [1 = slider.bet_slider]
/ showpagenumbers = false
/ showquestionnumbers = false
/ nextbuttonposition = (40%, 90%)
/ finishlabel = "Place bet"
/ navigationbuttonsize = (20%, 6%)
/ navigationbuttonfontstyle = ("Arial", 3.33%, false, false, false, false, 5, 1)
/ ontrialend = [
if (list.knownorderlist.nextvalue == 1) {values.known30bet = format("%.2f", slider.bet_slider.response/100)}
if (list.knownorderlist.nextvalue == 2) {values.known40bet = format("%.2f", slider.bet_slider.response/100)}
if (list.knownorderlist.nextvalue == 3) {values.known50bet = format("%.2f", slider.bet_slider.response/100)}
if (list.knownorderlist.nextvalue == 4) {values.known60bet = format("%.2f", slider.bet_slider.response/100)}
if (list.knownorderlist.nextvalue == 5) {values.known70bet = format("%.2f", slider.bet_slider.response/100)}
]
/ ontrialend = [
if (list.knownorderlist.nextvalue == 1 && slider.bet_slider.response == "500") {values.known30bet = "5.00"}
if (list.knownorderlist.nextvalue == 2 && slider.bet_slider.response == "500") {values.known40bet = "5.00"}
if (list.knownorderlist.nextvalue == 3 && slider.bet_slider.response == "500") {values.known50bet = "5.00"}
if (list.knownorderlist.nextvalue == 4 && slider.bet_slider.response == "500") {values.known60bet = "5.00"}
if (list.knownorderlist.nextvalue == 5 && slider.bet_slider.response == "500") {values.known70bet = "5.00"}
]</surveypage>
<surveypage unknown_urn_page>
/ stimulustimes = [0 = unknown_urn_pics, urncontents_label, unknownodds, quittext, maintask_header]
/ questions = [1 = slider.bet_slider]
/ showpagenumbers = false
/ showquestionnumbers = false
/ nextbuttonposition = (40%, 90%)
/ finishlabel = "Place bet"
/ navigationbuttonsize = (20%, 6%)
/ navigationbuttonfontstyle = ("Arial", 3.33%, false, false, false, false, 5, 1)
/ ontrialend = [
if (list.unknownorderlist.nextvalue == 1) {values.unknown30bet = format("%.2f", surveypage.unknown_urn_page.response/100)}
if (list.unknownorderlist.nextvalue == 2) {values.unknown40bet = format("%.2f", surveypage.unknown_urn_page.response/100)}
if (list.unknownorderlist.nextvalue == 3) {values.unknown50bet = format("%.2f", surveypage.unknown_urn_page.response/100)}
if (list.unknownorderlist.nextvalue == 4) {values.unknown60bet = format("%.2f", surveypage.unknown_urn_page.response/100)}
if (list.unknownorderlist.nextvalue == 5) {values.unknown70bet = format("%.2f", surveypage.unknown_urn_page.response/100)}
]
/ ontrialend = [
if (list.unknownorderlist.nextvalue == 1 && slider.bet_slider.response == "500") {values.unknown30bet = "5.00"}
if (list.unknownorderlist.nextvalue == 2 && slider.bet_slider.response == "500") {values.unknown40bet = "5.00"}
if (list.unknownorderlist.nextvalue == 3 && slider.bet_slider.response == "500") {values.unknown50bet = "5.00"}
if (list.unknownorderlist.nextvalue == 4 && slider.bet_slider.response == "500") {values.unknown60bet = "5.00"}
if (list.unknownorderlist.nextvalue == 5 && slider.bet_slider.response == "500") {values.unknown70bet = "5.00"}
]</surveypage>