Desktop User Guides > Professional > Interview scripting > Writing interview scripts > Multiple-language scripts > Showing example input formats
Showing example input formats
There are various ways of entering numbers and dates in interviews, all of which depend to some extent on the interview’s language or locale. One of the most common problems relates to the decimal point: is it a comma or is it a dot? If the interview language is one that requires a comma as the decimal point, then any decimal responses that are entered with a dot will be rejected. Similarly, if the language is one that requires a dot as the decimal point, numbers that contain a comma will be rejected. The error message that the user sees depends on the browser language, the script language and locale, and the character entered as the decimal point, but it will usually state either that the response is not numeric or that the thousands separator is not allowed.
You can help respondents and interviewers avoid these problems by displaying an example of the required response format as part of the question. There are several ways of doing this.
Numbers with .Ask()
To mark the point at which the example response should be displayed, place an insert marker inside the question text. (For more information about inserts, see Programmatically inserting text into labels.)
Example is the name of the insert marker.
Fmt is an optional formatting string specifying how the value should be formatted. For more information, see Formatting substituted values.
For example:
WeeklyFood "How much do you spend on food in an average week? (e.g.
Then, type the Ask() statement as follows:
Name is the question name.
Value is a number.
When the question is displayed during interviews, the insert marker in the question text is replaced with this value, formatted according to the given format string and the interview language. Here are some examples produced by:
1234.50 (English) or 1234,50 (Continental European)
1234.500 (English) or 1234,500 (Continental European)
1,234.50 (English), 1 234,50 (French), or 1.234,50 (German)
There is no requirement for the value to be within the valid response range for the question, although it is helpful to respondents if it is.
Dates with .Ask()
To mark the point at which the example date should be displayed, place an insert marker of the following form inside the question text:
where Example and Fmt are as described previously. Then, in the routing section, type:
Name is the question name.
yyyy, mm, and dd are the date components.
When the question is displayed during interviews, the example date displays in the format required by the interview language. For example, if the question is
Expiry "When does your privilege card expire? (e.g.
  {exdate})" date;
and the routing section contains:
the date displays as follows:
Date displayed as
British English, Western European languages, and equivalents
US English and equivalents
Eastern European languages and equivalents
2023–12–31 (the separator character varies between countries)
Numbers or dates with Format()
The other way of specifying example values for both numbers and dates is to use the standard syntax for defining insert values together with the Format function
Name.Label.Inserts["Example"].Text = Format(Value, "Fmt", , IOM.Locale)
Name is the question name.
Example is the name of the insert marker in the question’s metadata.
Value is a number enclosed in double quotation marks or a CDate expression defining the value for Example.
Fmt is a formatting code the specifies how Value should be displayed.
For example, the previous examples could be written as:
WeeklyFood.Label.Inserts["spend"].Text = Format("12345","f2",,IOM.Locale)
Expiry.Label.Inserts["exdate"].Text = Format(CDate("2007-12-31"),"d",,IOM.Locale)
See also
Multiple-language scripts