Wiris

Documentation / WirisQuizzes

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • WirisQuizzes

      • LearningLemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • MathFlow

                • BF FAQ

                  • Miscellaneous

                    • Wiris Integrations

                      • Home
                      • WirisQuizzes
                      • Validation Options
                      • Numbers representation, tolerance and precision
                      • Numbers representation, tolerance and precision

                      Comparison by rounding

                      Reading time: 1min

                      As you may have noticed, both significant figures and decimal places comparison methods use the truncation function. Conversely, you may be interested in replicating the same behavior using the rounding function. Below, you can find two alternative procedures to achieve this.

                      Using absolute error tolerance and a concrete number of decimals assertion

                      The first option requires combining two assertions we have previously analyzed: absolute error and a concrete number of decimals. If we want to check that the student's answer has exactly n decimal places, and that these match the first n decimal places of the correct answer after rounding, we must set:

                      • The error margin to 0.5·10⁻ⁿ
                      • The precision to n decimal places
                         
                        For instance, if the correct answer is 19.586
                      Student Answer
                      Decimal places 19.6 19.59 19.58 19.587 19.586
                      1
                      2
                      3
                      4

                      Using a grading function

                      The second option requires some programming in CalcMe using a grading function. To check that the first n decimal places of the student and correct answers are identical after rounding, you can define a user-defined routine. For example, for n = 2.

                      💡 Tip
                      You can learn more about grading functions here.

                      For instance, if the correct answer is 19.586

                      Student Answer
                      Decimal places 19.6 19.59 19.58 19.587 19.586
                      1
                      2
                      3
                      4

                      Was this article helpful?

                      Give feedback about this article

                      Related Articles

                      • Debugging (what to do if it isn't working)
                      • Repeating decimal

                      Comparison by rounding

                      Using absolute error tolerance and a concrete number of decimals assertion Using a grading function

                      Empowering STEM education

                      MathType

                      • Office Tools
                      • LMS
                      • XML
                      • HTML

                      WirisQuizzes

                      Learning Lemur

                      Integrations

                      Solutions

                      • Education
                      • Publishing houses – platforms and interactive
                      • Publishing houses – Print and digital
                      • Technical writers

                      Pricing

                      Downloads

                      Blog

                      • Success stories

                      About us

                      • Careers
                      • Partnership

                      Contact Us

                      Contact Sales

                      European union (European Regional Development Fund) and 1EdTech (TrustEd Apps Certified)
                      • Cookie Policy
                      • Terms of Use
                      • Privacy Policy / GDPR
                      • Student Data Privacy
                      • Compliance
                      • Cookie Settings

                      © Wiris 2026

                      Expand