Decimal
Decimal questions आपके survey में fractional parts के साथ numeric inputs की अनुमति देते हैं।
XLSForms और rtSurvey में decimal question type का उपयोग ऐसे numeric responses एकत्र करने के लिए किया जाता है जिनमें fractional parts शामिल हो सकते हैं। यह question type measurements, prices, या percentages जैसे precise numerical data gather करने के लिए आवश्यक है।
Basic XLSForm Specification
| type | name | label |
|---|---|---|
| decimal | weight | अपना वजन kg में दर्ज करें |
Basic decimal question type के बारे में अधिक जानकारी के लिए, XLSForm specification देखें।
उपयोग
Decimal questions सामान्यतः इनके लिए उपयोग किए जाते हैं:
- Measurements (जैसे वजन, ऊँचाई, दूरी)
- Financial data (जैसे prices, salaries)
- Percentages
- Scientific data collection
- कोई भी numeric data जिसके लिए whole numbers से परे precision की आवश्यकता हो
Best Practices
- Expected input और measurement की unit निर्दिष्ट करने के लिए clear और concise labels का उपयोग करें।
- Unrealistic या erroneous inputs को रोकने के लिए range constraints लागू करें।
- Expected format को स्पष्ट करने या उदाहरण प्रदान करने के लिए hint text का उपयोग करने पर विचार करें।
- यदि precision महत्वपूर्ण है तो label या hint में desired decimal places की संख्या निर्दिष्ट करें।
Constraints और Validation
आप यह सुनिश्चित करने के लिए constraints जोड़ सकते हैं कि दर्ज किया गया मूल्य एक specific range में हो:
| type | name | label | constraint | constraint_message |
|---|---|---|---|---|
| decimal | height | अपनी ऊँचाई meters में दर्ज करें | .>0 and .<=3 | ऊँचाई 0 और 3 meters के बीच होनी चाहिए |
Example Usage
यहाँ बताया गया है कि आप health survey में decimal questions का उपयोग कैसे कर सकते हैं:
| type | name | label | constraint | constraint_message |
|---|---|---|---|---|
| decimal | weight | अपना वजन kg में दर्ज करें | .>0 and .<=500 | वजन 0 और 500 kg के बीच होना चाहिए |
| decimal | height | अपनी ऊँचाई meters में दर्ज करें | .>0 and .<=3 | ऊँचाई 0 और 3 meters के बीच होनी चाहिए |
| decimal | body_temp | Celsius में अपना body temperature दर्ज करें | .>=35 and .<=42 | Temperature 35°C और 42°C के बीच होना चाहिए |
| calculate | bmi |
BMI के लिए calculate row में, आप इसका उपयोग कर सकते हैं:
calculation | ${weight} / (${height} * ${height})
यह दर्ज किए गए weight और height का उपयोग करके BMI calculate करेगा।
rtSurvey Extensions
Basic XLSForm specification के अतिरिक्त, rtSurvey अतिरिक्त सुविधाएं प्रदान कर सकता है:
- Precision control (decimal places की संख्या)
- Custom input formats (जैसे percentage, currency)
- Advanced validation rules
सीमाएं
- Decimal numbers की precision underlying system या database द्वारा सीमित हो सकती है।
- Users को उनकी locale के आधार पर expected decimal separator (period या comma) पर मार्गदर्शन की आवश्यकता हो सकती है।
- Mobile devices पर बड़े decimal numbers को पढ़ना या सटीक रूप से input करना कठिन हो सकता है।