Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Where to enable thousands separators?

  • Username123
  • Username123's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #231880 by Username123
Where to enable thousands separators? was created by Username123
Your LimeSurvey version: Version 5.1.10+210913
Own server or LimeSurvey hosting: hosting
==================

I can't find any checkbox to enable or disable thousands separators in my survey. Neither in the survey settings, nor in the settings in questions with numerical inputs.
Some questions in my survey require large numerical values to be entered. Currently, thousands separators are not displayed. But these would be urgently needed. 

Thanks for your support. 

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 7 months ago #231883 by holch
Replied by holch on topic Where to enable thousands separators?
I don't think this is a feature that can be enabled anywhere.

Most probably you will have to create a "mask" for the specific questions, probably via Javascript. Not sure if you are allowed to do this. You said "hosting" in the basic questions, I assume you are referring to the hosting service of Limesurvey?

There are few examples in the manual, but they seem to be for very old versions, so they might not work for LS5, but to give you an idea:
manual.limesurvey.org/Workarounds:_Manip...ipt#Text_input_masks

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: Username123

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 7 months ago #231898 by Joffm
Replied by Joffm on topic Where to enable thousands separators?
As @holch already indicated,
you may use a mask.
Have a look here
[url] igorescobar.github.io/jQuery-Mask-Plugin/docs.html#basic-usage [/url]

The two "money" examples.
Here two examples (without/with decimals)
 

Masks:
1. .mask('#.##0', { reverse: true });
2. .mask('#.##0,00', { reverse: true });

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Username123

Please Log in to join the conversation.

  • Username123
  • Username123's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #231903 by Username123
Replied by Username123 on topic Where to enable thousands separators?
But can I do this if I get LimeSurvey from my university with a design template? I don't have the rights to change the template.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 7 months ago #231913 by Joffm
Replied by Joffm on topic Where to enable thousands separators?
Oh, university.

But as you saw, you only have to enter some havascript (into your question text).
No changes to the theme are needed.

First make sure that you are allowed to use javascript. Some university admins don't allow it.

So enter this into the text of a question (in source code mode):
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
  alert('Hi, javascript speaking ...');
});
</script>
If this pops up, fine.

Now in your question at first include the library
Code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.16/jquery.mask.js"></script>

Now include the mask (this shows the input into a "short text" question.)
Code:
<script type="text/javascript" charset="utf-8">
    $(document).on('ready pjax:scriptcomplete',function(){       
      $('#question{QID} input[type="text"]').mask('#.##0', { reverse: true });
    });
</script>
 

If you use a different question type you have to adapt.
This shows the input into the second field (you see "eq(1)" of a "multiple short text" question.

         $('#question{QID} .question-item:eq(1) input[type="text"]').mask('#.##0', { reverse: true });


BTW.:
If you are allowed to install plugins:
@DenisChenu used this library for his plugin "jquerySimpleMask" (only for "multiple short text")
[url] gitlab.com/SondagesPro/QuestionSettingsType/jquerySimpleMask [/url]

Joffm

P.S.
If you are able to read German (or use "Google Translate" ) you may read
"Joffms Tutorial 3: Gimmicks und ..." in the German part of the forom (Chapter 5)
Just scroll down a bit (Page 4 or 5)

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Username123

Please Log in to join the conversation.

  • Username123
  • Username123's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #231917 by Username123
Replied by Username123 on topic Where to enable thousands separators?
Awesome, this works perfectly :)

And thanks for pointing out the tutorial :) I actually speak German, so I'll definitely check it out.

Please Log in to join the conversation.

More
1 year 7 months ago #231923 by jelo
Replied by jelo on topic Where to enable thousands separators?
In the light of the court order in Germany, that you need a consent to submit IP-addresses to other parties (in that case is was about embedding Google Fonts via external URL), the usage of
Code:
[color=#339933]<[/color]script src[color=#339933]=[/color][color=#3366cc]"https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.16/jquery.mask.js"[/color][color=#339933]></[/color]script[color=#339933]>[/color]
results in submitting the IP-address to Cloudflare for every survey visitor.

Many websites in Germany do this. And the risk to get in trouble is low. I would try to get that file hosted on a university server (e.g. students homepage etc.).
www.kuketz-blog.de/cloudflare-cdn-altern...-deutschland-europa/ (GERMAN)

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 7 months ago #231924 by Joffm
Replied by Joffm on topic Where to enable thousands separators?

results in submitting the IP-address to Cloudflare for every survey visitor.

Oh, I didn't know this.

IF you are allowed to do,
download the zip-file, extract it and
upload the *.js  to the files directory of your survey.
"Ressources"
 
Then you call it from there.

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 7 months ago #231925 by jelo
Replied by jelo on topic Where to enable thousands separators?

results in submitting the IP-address to Cloudflare for every survey visitor.

Oh, I didn't know this.
 
We all know that to have a connection between a server and a client an IP-address exchange is needed ;-)
Not sure where this all ends, but selfhosting as much as possible helps here to get letters from lawyers with hefty costnotes.

I would recommend to selfhost from a pure security standpoint. That way you prevent getting victim of a supplychainattack and you always know what library version is running.
thehackernews.com/2021/07/cloudflare-cdn...uld-have-led-to.html
 

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258209 by DenisChenu
Replied by DenisChenu on topic Where to enable thousands separators?
> @DenisChenu used this library for his plugin "jquerySimpleMask" (only for "multiple short text")

For short text and/or multiple text :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose