Formatting piped text | XM Community
Solved

Formatting piped text

  • 7 January 2019
  • 6 replies
  • 50 views

I am reminding participants what they selected on a slider scale in a previous portion of the survey using piped text. I would like to format this piped text by adding a dollar sign and commas to it. Is there a way to do that using custom CSS code?
icon

Best answer by TomG 7 January 2019, 20:06

View original

6 replies

Userlevel 7
Badge +27
You can't format a number (e.g. add commas) with CSS. You would have to write JavaScript. For a $ sign you could just put the $ character before your piped text.
Thank you! That worked for the dollar sign. Do you have java script code for the commas? I don't know java
Userlevel 3
Badge +8

Hi,
Did you ever figure out the formatting with commas and perhaps a decimal (if needed)? It woudl be something like a $ 1,000.00 type of format?
I am in the same need after generating pricing.
Thanks,
Adam

Userlevel 7
Badge +27

https://www.qualtrics.com/community/discussion/comment/27912#Comment_27912You can use wNumb to format a number with $ and commas.

Userlevel 3
Badge +8

https://www.qualtrics.com/community/discussion/comment/27913#Comment_27913Thanks TomG! Does that require placing something for reference in the header or footer of the survey? Was a little uncertain how the reference is made there.

Userlevel 7
Badge +27

Yes, you need to load the wnumb script in the header. You can load it from jsdelivr.com and it will create the appropriate script tag for you.

Leave a Reply