Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:create:filter-texts [06.12.2014 15:08] – [Compare Text] alexander.ritteren:create:filter-texts [10.12.2014 15:07] – [Numbers in the Input] alexander.ritter
Line 95: Line 95:
 </code> </code>
  
-Likewise, PHP can be instructed to convert the participant's input into a number as far as possible. Therefore, "5b" becomes ''5''. The conversion takes place with the function ''intval()'' or with the prefix ''(int)'' (so-called type casting). +Likewise, PHP can be instructed to convert the participant's input into a number as best as possible. Therefore, "5b" becomes ''5''. The conversion takes place with the function ''intval()'' or with the prefix ''(int)'' (also known as type casting). 
  
 <code php> <code php>
Line 111: Line 111:
 </code> </code>
  
-**Take care:** Decimal places are cut off when using this solution. If you want to work with decimals, you have to first of all make sure that a period is used as the decimal separator (if necessary, set that a text input only allows decimals in SoSci Survey) and then carry out the conversion into a number using the prefix ''(float)''+**Take care:** Decimal places are cut off when using this solution. If you want to work with decimals, you have to first of all make sure that a period is used as the decimal separator (if necessary, set a text input that only allows decimals in SoSci Survey) and then carry out the conversion into a number using the prefix ''(float)''
  
-**Vorsicht:** Nachkommastellen werden bei dieser Lösung abgeschnitten. Möchte man mit Dezimalzahlen arbeiten, muss man zunächst dafür sorgen, dass als Dezimaltrennzeichen der Punkt verwendet wird (ggf. in SoSci Survey einstellen, dass eine Texteingabe nur Dezimalzahlen erlaubt) und anschließend mittels vorangestelltem ''(float)'' die Umwandlung in eine Zahl vornehmen. 
en/create/filter-texts.txt · Last modified: 15.01.2015 20:23 by alexander.ritter
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki