slidernumformat
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| slidernumformat [2024/08/21 12:13] – created admin | slidernumformat [2025/02/13 07:25] (current) – [Add Function To Survey] admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== sliderNumFormat - Format slider scale and value numbers ====== | ====== sliderNumFormat - Format slider scale and value numbers ====== | ||
| - | The **sliderNumFormat** function formats scale numbers (above the sliders) and values (appear when you drag a slider). It allows scale and value formats to be the same or different. The function uses [[https:// | + | The **sliderNumFormat** function formats scale numbers (above the sliders) and values (appear when you drag a slider). It allows scale and value formats to be the same or different. The function uses **[[https:// |
| * Thousands separators (e.g., 1,000) | * Thousands separators (e.g., 1,000) | ||
| * Decimals (e.g., 1,000.00) | * Decimals (e.g., 1,000.00) | ||
| Line 8: | Line 8: | ||
| * Scientific (e.g., 1.000E3) | * Scientific (e.g., 1.000E3) | ||
| * Compact (e.g., $1K) | * Compact (e.g., $1K) | ||
| + | |||
| + | sliderNumFormat works with all Qualtrics layouts including "New Survey Experience" | ||
| Here is a simple example:\\ | Here is a simple example:\\ | ||
| Line 14: | Line 16: | ||
| This function is available for a reasonable fee. Contact **[[https:// | This function is available for a reasonable fee. Contact **[[https:// | ||
| ===== Set-up Instructions ===== | ===== Set-up Instructions ===== | ||
| - | ==== Add Function To Survey ==== | + | ==== Survey Header ==== |
| + | === Add jQuery (only if using New Survey | ||
| + | < | ||
| + | <script src=" | ||
| + | </ | ||
| + | === Add sliderNumFormat Function | ||
| Add the sliderNumFormat function to the survey header to make it available to any question in the survey. Go to Look & Feel -> General -> Header edit -> {{:: | Add the sliderNumFormat function to the survey header to make it available to any question in the survey. Go to Look & Feel -> General -> Header edit -> {{:: | ||
| < | < | ||
| Line 31: | Line 38: | ||
| < | < | ||
| Qualtrics.SurveyEngine.addOnload(function() { | Qualtrics.SurveyEngine.addOnload(function() { | ||
| - | mfCsSliders(this, | + | sliderNumFormat(this, |
| }); | }); | ||
| </ | </ | ||
| - | ==== Question Settings ==== | ||
| - | * Slider question | ||
| - | * Type: Sliders | ||
| - | * Custom Start Position: Off | ||
| - | * Scale Points: 0 to 100 (or some other max) | ||
| - | * Show value: Off | ||
| - | * Mobile friendly: On | ||
| ===== Options ===== | ===== Options ===== | ||
| ==== format ==== | ==== format ==== | ||
| - | **format** is a numeric value that specifies what the constant sum must total to when **[[mfcssliders# | + | **format** is a object used to specify the Intl.NumberFormat() formatting options. Options are specified the same way as in the **[[https:// |
| - | Default: | + | Default: |
| ==== locale ==== | ==== locale ==== | ||
| - | **locale** is a string or array that specifies the locale or locales to be used by Intl.NumberFormat. | + | **locale** is a string or array that specifies the locale or locales to be used by Intl.NumberFormat(). |
| Default: %%" | Default: %%" | ||
| + | ==== valueFormat ==== | ||
| + | **valueFormat** is an object that specifies the Intl.NumberFormat() formatting options for value numbers. Options are specified the same way as in the **[[https:// | ||
| - | ==== mustTotalFlag | + | Default: {} |
| - | **mustTotalFlag** is a boolean | + | ==== scaleFormat |
| - | + | **scaleFormat** is an object | |
| - | Default: true | + | |
| - | ==== prefix ==== | + | |
| - | **prefix** is text that is shown before numeric values. | + | |
| - | + | ||
| - | Default: %%"" | + | |
| - | ==== suffix ==== | + | |
| - | **suffix** is text that is show after numeric values. | + | |
| - | + | ||
| - | Default: %%" | + | |
| - | ==== widths ==== | + | |
| - | **widths** is the width of the constant sum numbers in ems. An ' | + | |
| - | Default: | + | Default: |
| ====== Qualtrics Wiki ====== | ====== Qualtrics Wiki ====== | ||
| [[start|Qualtrics Wiki]] | [[start|Qualtrics Wiki]] | ||
slidernumformat.1724256791.txt.gz · Last modified: by admin
