Professional > Interview scripting > Interview scripting: Getting started > Writing a decimal question
 
Writing a decimal question
A decimal question requires a response that contains a decimal point and at least one decimal place. The Interview Scripting Language calls these double questions.
In this example, we will write a question that looks like this when you run the interview:
Procedure
1 Enter a name for the question followed by the question text in double quotation marks:
Metadata(en-us, Question, label)
  SurveyTitle "Tea Survey" info;
  Email "What is your email address?" text [10..50];
  HowMany "How many cups of tea do you drink in an average week?" long [0..99];
  HowMuch "How much do you usually pay when you buy a cup of tea?"
End Metadata
2 Add the double keyword to specify that this is a double question, and follow this with the range of acceptable response values (0 to 9) enclosed in square brackets. End the question with a semicolon. (The example shows this text on a separate line, but this is for printing purposes only. You can type everything on the same line.)
Metadata(en-us, Question, label)
  SurveyTitle "Tea Survey" info;
  Name "What is your name?" text [2..40];
  HowMany "How many cups of tea do you drink in an average week?" long [0..99];
  HowMuch "How much do you usually pay when buy a cup of tea?"
double [0..9];End Metadata
3 If you use F5 to run your interview you will find that you can enter numbers with up to two decimal places. Facilities are available for setting the number of decimal places to use when writing out data. For more information, see Questions with decimal responses.
Requirements
UNICOM Intelligence Professional with Interview Scripting.
See also
Interview scripting: Getting started