I am currently designing a choice list on Qualtrics, where the right-side options consist of varying numerical values. For example, I have the embedded data "EV_unit_01" as 0.05 in the survey flow, and then edit the option label as: <span style="font-size:18px;"><span style="font-family:Arial,Helvetica,sans-serif;">obtain<strong> £$e{e://Field/Formatted_EV * XX}</strong> for sure</span></span>
Here, XX is from a sequence from 1 to 19, and the derived number is 0.05, 0.1, 0.15,...
My objective is to consistently format each of these values with two decimal places to enhance the overall appearance of the list. That is, I want to have the derived number displayed as 0.05, 0.10, 0.15,...
So, I have added codes like below:
Qualtrics.SurveyEngine.addOnload(function() {
var sourceValue = "${e://Field/EV_unit_01}";
var formattedValue = parseFloat(sourceValue).toFixed(2);
Qualtrics.SurveyEngine.setEmbeddedData("Formatted_EV", formattedValue);
});
and set "Formatted_EV" as “value will be set from Panel or URL” in the survey flow.
Finally, I revised the option label as:
<span style="font-size:18px;"><span style="font-family:Arial,Helvetica,sans-serif;">obtain<strong> £$e{e://Field/Formatted_EV * XX}</strong> for sure</span></span>
However, this does not give what I expect, but shows “obtain £0 for sure” on page. Then, after some googlework, I notice that someone says we cannot “set the value of an Embedded Data and call it using piped text within the same question” (see this). Thus, I simply add a pure text question with a page break. Wow, I can see the original number again, but the digital number is not fixed to 2 (i.e., still 0.05, 0.1, ...). So, it seems that toFixed function does not work.
At the moment, I have no clue how to achieve my goal. I will be very glad if you can share your wisdom here.
Thanks for your attention.