Search the Legacy Support Archive (up to v2020)
  1. Read-only archive (2005–2024). Posting is closed. Need help with MediaLab or DirectRT 2027? Email service@empirisoft.com.

    All words · “exact phrase” · -leave out

    Advanced search

decimal places for calculated variables

  1. #1

    decimal places for calculated variables

    Hello,

    At the end of my experiment subjects are given feedback about how much they earned. This is a calculated variable dependent on their own and others' choices during the study. Here's my problem: when medialab displays the earnings, there are about 10 decimal places (e.g. 11.33333333333). I'd like to limit it to 2 decimal places. I've tried formatting the cells in excel, but nothing seems to work. (By the way, the item type is fill-in-the-blank...I haven't had this problem for scale response items.) Any thoughts?

    Thanks.

  2. #2
    jarvis24 Blair Jarvis, Administrator
    Have not done this before but you could try this. Create a new variable based on the value you want to use (e.g., 3.333333333) then in the value cell for that variable enter something like

    =TEXT(B1, "$0.00")

    or

    =TEXT(B1, "00.000")

    And that sort of thing. I got thsi from the section on the "text" function in Excel:

    Converts a value to text in a specific number format.
    Syntax
    TEXT(value,format_text)
    Value is a numeric value, a formula that evaluates to a numeric value, or a reference to a cell containing a numeric value.
    Format_text is a number format in text form from in the Category box on the Number tab in the Format Cells dialog box.
    Remarks
    • Format_text cannot contain an asterisk (*).
    • Formatting a cell with an option on the Number tab (Cells command, Format menu) changes only the format, not the value. Using the TEXT function converts a value to formatted text, and the result is no longer calculated as a number.
    Example
    The example may be easier to understand if you copy it to a blank worksheet.