Add Comma to Slider Label | XM Community
Solved

Add Comma to Slider Label

  • 30 January 2019
  • 2 replies
  • 38 views

Hi everyone,

I have a slider with labels on top indicating dollar values. How do I add a comma to separate each 000? The label current look like "1000" - how do I turn that into "1,000"?
icon

Best answer by Anonymous 19 March 2019, 03:25

View original

2 replies

Hello @1ag0 ,

Paste the below code in the js(OnReady) of the question:

var s=["$0","$2,000","$4,000","$6,000","$8,000"];
for(var i=0;i<s.length;i++){
jQuery(".TickContainer span:eq("+i+")").html(s[i]);
}
Userlevel 1
Badge +1

Has anyone found a solution to add a "," to the slider options? Trying to show slider options as "$0", "$100,000", "$200,000", "$300,000, "$400,000", "$500,000". Thanks for any help!

Leave a Reply