- Posts: 65
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Decimal places in answer
- jimdavies
- Topic Author
- Offline
- Senior Member
Less
More
5 years 8 months ago #171635
by jimdavies
Decimal places in answer was created by jimdavies
How can I force an answer to be a numerical value with 2 decimal places?
This is the question "Provide the current program scorecard score for the program you manage."
I need the participants to answer 97.95, for example.
This is the question "Provide the current program scorecard score for the program you manage."
I need the participants to answer 97.95, for example.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12789
- Thank you received: 3940
5 years 8 months ago #171636
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Decimal places in answer
Hi,
you can validate the question (numerical) with is_empty(self) OR regexMatch('/^[0-9]+(\.[0-9][0-9])$/',self)
Best regards
Joffm
you can validate the question (numerical) with is_empty(self) OR regexMatch('/^[0-9]+(\.[0-9][0-9])$/',self)
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- jimdavies
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 65
- Thank you received: 0
5 years 8 months ago #171637
by jimdavies
Replied by jimdavies on topic Decimal places in answer
Do I need to add some advanced settings? When I preview the survey it allows me to put in anything, it doesn't force 2 decimals.
Attachments:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
5 years 8 months ago #171644
by DenisChenu
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.
Replied by DenisChenu on topic Decimal places in answer
Question validation (and you can set the tip)
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.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12789
- Thank you received: 3940
5 years 8 months ago - 5 years 8 months ago #171662
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Decimal places in answer
Hi,
With this settings:
you will get:
Best regards
Joffm
Yes, you can put in anything - but you cannot proceed.When I preview the survey it allows me to put in anything, it doesn't force 2 decimals.
With this settings:
you will get:
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last edit: 5 years 8 months ago by Joffm.
The topic has been locked.
- jimdavies
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 65
- Thank you received: 0
5 years 8 months ago #171693
by jimdavies
Replied by jimdavies on topic Decimal places in answer
Could you paste in the question validation tip so I can copy and paste it?
The topic has been locked.
- jimdavies
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 65
- Thank you received: 0
5 years 8 months ago #171695
by jimdavies
Replied by jimdavies on topic Decimal places in answer
Attachments:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
5 years 8 months ago #171699
by DenisChenu
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.
Replied by DenisChenu on topic Decimal places in answer
Look at the picture of Joffm please :
you leave the test on Validation : you must remove it from here …
you leave the test on Validation : you must remove it from here …
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.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12789
- Thank you received: 3940
5 years 8 months ago #171727
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Decimal places in answer
Hi,
you put the validation in "validation"; you should have put it into "question validation equation"
and there is a missing quote before the "positive" tip.
Joffm
you put the validation in "validation"; you should have put it into "question validation equation"
and there is a missing quote before the "positive" tip.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: jimdavies
The topic has been locked.
- jimdavies
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 65
- Thank you received: 0
5 years 8 months ago #171745
by jimdavies
Replied by jimdavies on topic Decimal places in answer
I was able to get it to work on question #3 but it's not working on question #5. When I preview the question it appears to work but when I preview the survey I get a red exclamation mark. I compared the validation code and they appear to match between #3 and #5. Only diff I see is #5 has a condition.
Attachments:
The topic has been locked.