Number Format Embedded Data Values | XM Community
Skip to main content
Question

Number Format Embedded Data Values

  • October 18, 2023
  • 1 reply
  • 80 views

Forum|alt.badge.img

How can I implement the formatting of calculated values derived from my survey flow using embedded data to incorporate thousand separators? These values are initially calculated without thousand separators, and I am seeking a solution to add the necessary formatting after the calculation process within the survey flow. I suspect this may necessitate Java or HTML coding, but as I lack prior coding experience, I would greatly appreciate assistance in providing the relevant code, if feasible.

1 reply

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • 654 replies
  • October 19, 2023

We cannot do it in survey flow since we cannot run JS there, however on a question we can use below script to update JS with required format.

const n = 716298462; //pipe in the number here
const formatted = n.toLocaleString('en-US');
console.log(formatted);
Qualtrics.SurveyEngine.setEmbeddedData("number", formatted);