Relationship Graph View Issue Dependency Graph
related to child of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
15513Feature requests[All Projects] _ Unknownpublic2020-01-13 14:36
Reporterollehar Assigned ToDenisChenu  
PrioritynoneSeverityfeature 
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version3.0 
Summary15513: Missing function floatval() in EM
Description

Both intval and floatval is necessary if you want to do numerical compare correctly.

TagsNo tags attached.

Activities

HSwebteam

HSwebteam

2019-11-18 13:18

reporter   ~54642

I think this is exactly the issue I came across today
The manual suggest that if you want to compare a numerical input field to a constant (like 'AGE' to a number) you can add 'age > 18' under 'set conditions', but this gives me an error in the Relevance Equation: "This expression uses invalid comparaison. Are you sure you didn't mean numerical compare?". But there is not option in 'conditions' where you can tell Limesurvey that indeed I meant to compare two numbers.

ollehar

ollehar

2019-11-18 14:18

administrator   ~54653

@HSwebteam You got a warning, not an error - the survey will run even if you have warnings.

Feel free to upload your survey here, if it's not private. Then we can have a look. NB: There is intval() you can use for age.

DenisChenu

DenisChenu

2019-11-19 15:01

developer   ~54684

sum(QCODE.NAOK) don't do the trick (false good idea).

It's an easy to add except float are different in PHP and JS id i don't make error ;).

Else
I just check : using condition editor : put 18 : compare is done as numeric : no issue are shown …

DenisChenu

DenisChenu

2019-11-19 15:56

developer   ~54692

Seems really easy to add ;)
https://locutus.io/php/var/floatval/

:)
3.X or 4.X ?
In 4.X : maybe in a core plugin :p

ollehar

ollehar

2019-11-19 16:14

administrator   ~54696

Should be in 3 already, since we have the warning system.

intval() is no plugin. floatval() should be same.

DenisChenu

DenisChenu

2019-11-20 12:31

developer   ~54706

https://github.com/LimeSurvey/LimeSurvey/pull/1344

DenisChenu

DenisChenu

2019-11-20 12:36

developer  

limesurvey_survey_checkFloatAndIntVal.lss (30,380 bytes)
DenisChenu

DenisChenu

2019-11-28 15:08

developer   ~54873

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=29273

Related Changesets

LimeSurvey: master bdc78c15

2019-11-28 15:08:36

DenisChenu


Committer: ollehar Details Diff
New feature 15513: Missing function floatval() in EM (#1344)

Dev: check 150.03_page-section php vs js : OK
Affected Issues
15513
mod - application/helpers/expressions/em_core_helper.php Diff File
mod - assets/scripts/expressions/em_javascript.js Diff File

Issue History

Date Modified Username Field Change
2019-11-01 13:42 ollehar New Issue
2019-11-18 13:18 HSwebteam Note Added: 54642
2019-11-18 14:18 ollehar Note Added: 54653
2019-11-19 15:01 DenisChenu Note Added: 54684
2019-11-19 15:56 DenisChenu Note Added: 54692
2019-11-19 16:14 ollehar Note Added: 54696
2019-11-19 16:30 DenisChenu Assigned To => DenisChenu
2019-11-19 16:30 DenisChenu Status new => assigned
2019-11-20 12:31 DenisChenu Assigned To DenisChenu => ollehar
2019-11-20 12:31 DenisChenu Status assigned => testing
2019-11-20 12:31 DenisChenu Note Added: 54706
2019-11-20 12:36 DenisChenu File Added: limesurvey_survey_checkFloatAndIntVal.lss
2019-11-20 12:36 DenisChenu File Added: Capture d’écran du 2019-11-20 12-36-04.png
2019-11-20 12:36 DenisChenu Relationship added related to 15598
2019-11-28 15:08 ollehar Changeset attached => LimeSurvey master bdc78c15
2019-11-28 15:08 DenisChenu Note Added: 54873
2019-11-28 15:08 DenisChenu Assigned To ollehar => DenisChenu
2019-11-28 15:08 DenisChenu Resolution open => fixed
2020-01-13 14:36 DenisChenu Status testing => resolved
2020-01-13 14:36 DenisChenu Fixed in Version => 3.0