# Why does it accept letters after number in math input

**URL:** https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252
**Category:** Discussion
**Created:** [May 7, 2021, 4:50pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252 "2021-05-07T16:50:34Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Jennifer\_Meikrantz](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_meikrantz/32/1338_2.png) [@Jennifer\_Meikrantz](https://cl.desmos.com/u/Jennifer_Meikrantz)
#### Post date: [May 7, 2021, 4:50pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/1 "2021-05-07T16:50:34Z")

</div>

I teach on-grade level and struggling math 6 students who continue to argue with me that Desmos is accepting their answer of 3n when the answer is n=3 and I coded it to check the numeric value of 3. Can anyone explain to me either  
A) Why Desmos does this - is it on purpose???  
or  
B) What can I do to code it to stop doing that?

---

<div class="post-metadata">

### Author: ![Mike\_Gleeson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mike_gleeson/32/650_2.png) [@Mike\_Gleeson](https://cl.desmos.com/u/Mike_Gleeson)
#### Post date: [May 7, 2021, 5:14pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/2 "2021-05-07T17:14:43Z")

</div>

Can you share what you have?

---

<div class="post-metadata">

### Author: ![Jennifer\_Meikrantz](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_meikrantz/32/1338_2.png) [@Jennifer\_Meikrantz](https://cl.desmos.com/u/Jennifer_Meikrantz)
#### Post date: [May 7, 2021, 5:28pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/3 "2021-05-07T17:28:48Z")

</div>

```auto
correct: eq1.numericValue=14

disableEvaluation: true

```

![Screen Shot 2021-05-07 at 1.28.27 PM](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/9/96dd22805ad80ccb59af166759300c5dfe21dcf3.png)

---

<div class="post-metadata">

### Author: ![Mike\_Gleeson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mike_gleeson/32/650_2.png) [@Mike\_Gleeson](https://cl.desmos.com/u/Mike_Gleeson)
#### Post date: [May 7, 2021, 5:42pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/4 "2021-05-07T17:42:12Z")

</div>

Could you share a link to the activity? The devil is often in the details

---

<div class="post-metadata">

### Author: ![Jennifer\_Meikrantz](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_meikrantz/32/1338_2.png) [@Jennifer\_Meikrantz](https://cl.desmos.com/u/Jennifer_Meikrantz)
#### Post date: [May 7, 2021, 5:57pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/5 "2021-05-07T17:57:23Z")

</div>

[https://teacher.desmos.com/activitybuilder/custom/608c4bd209a0655a72d493a6?collections=5fb2acf588c8040cedae8d0c](https://teacher.desmos.com/activitybuilder/custom/608c4bd209a0655a72d493a6?collections=5fb2acf588c8040cedae8d0c)

---

<div class="post-metadata">

### Author: ![Aethir](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/aethir/32/2767_2.png) [@Aethir](https://cl.desmos.com/u/Aethir)
#### Post date: [May 7, 2021, 6:10pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/6 "2021-05-07T18:10:43Z")

</div>

When you ask it to check numericValue, it will do exactly what you are seeing. If you want it to be exactly 3, you could do something like this using patterns:

```auto
patterns.number.satisfies("x=3").matches(this.latex)

```

or

```auto
patterns.literal("3").matches(this.latex)

```

I think, for either of those, if they type anything other than 3, it will NOT match.

---

<div class="post-metadata">

### Author: ![Jennifer\_Meikrantz](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_meikrantz/32/1338_2.png) [@Jennifer\_Meikrantz](https://cl.desmos.com/u/Jennifer_Meikrantz)
#### Post date: [May 12, 2021, 1:28pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/7 "2021-05-12T13:28:33Z")

</div>

Thank you. I guess I just don’t understand why a numeric value doesn’t automatically imply _exclusively_ a numeric value.

---

<div class="post-metadata">

### Author: ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)
#### Post date: [May 13, 2021, 5:31pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/8 "2021-05-13T17:31:34Z")

</div>

You could also use:

```auto
this.numericValue=3 and patterns.number.matches(this.latex)

```

---

<div class="post-metadata">

### Author: ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)
#### Post date: [May 13, 2021, 5:35pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/9 "2021-05-13T17:35:08Z")

</div>

> [@Jennifer\_Meikrantz](#):
>
> I guess I just don’t understand why a numeric value doesn’t automatically imply _exclusively_ a numeric value.

I’m wondering if it is to allow students to enter something like “3 meters” and still accept it without having to explicitly code all the variations of units a student might enter.

---

<div class="post-metadata">

### Author: ![Jennifer\_Meikrantz](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_meikrantz/32/1338_2.png) [@Jennifer\_Meikrantz](https://cl.desmos.com/u/Jennifer_Meikrantz)
#### Post date: [May 13, 2021, 5:46pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/10 "2021-05-13T17:46:28Z")

</div>

That’s what I would think **if** it required a space after the numeric value.

---

<div class="post-metadata">

### Author: ![Mike\_Gleeson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mike_gleeson/32/650_2.png) [@Mike\_Gleeson](https://cl.desmos.com/u/Mike_Gleeson)
#### Post date: [May 13, 2021, 8:13pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/11 "2021-05-13T20:13:32Z")

</div>

For whatever it’s worth I think it’s rather strange too. I can… sort of buy the units thing, but not really when other seemingly similar things result in errors.

---

<div class="post-metadata">

### Author: ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)
#### Post date: [May 13, 2021, 8:41pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/12 "2021-05-13T20:41:03Z")

</div>

Yes, that’s exactly it. It’s interpreting the letters as unit labels.

In the case that a student types something like 5meters we wouldn’t want to mark then incorrect (if in fact the answer is 5 meters) and erring on the side of allowing more false _positives_ than false _negatives_ leads us here.

One way we’ve worked around it is to evaluate the input as a function and make sure that it evaluates to itself at 0. Patterns are great too, but you need to be careful that you’re not marking a student wrong for a right answer in a different form. If only a number pattern is used, fractions, square roots, exponents, etc will all be marked wrong.

---

<div class="post-metadata">

### Author: ![Mike\_Gleeson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mike_gleeson/32/650_2.png) [@Mike\_Gleeson](https://cl.desmos.com/u/Mike_Gleeson)
#### Post date: [May 13, 2021, 8:57pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/13 "2021-05-13T20:57:57Z")

</div>

I think that’s a rather big semantic mistake, for the very reason brought up in this post.

Recall that the input is theoretically math, not a text field

```auto
1x≠1

```

Treating it as sorta-math sorta-text is not good.

That units problem is solvable through suffix and would avoid this issue. Just my opinion, but I think shared by others.

---

<div class="post-metadata">

### Author: ![Aethir](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/aethir/32/2767_2.png) [@Aethir](https://cl.desmos.com/u/Aethir)
#### Post date: [May 14, 2021, 2:47am UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/14 "2021-05-14T02:47:00Z")

</div>

I think Jay’s explanation makes sense, though, now that I think about it. If you want to be restrictive, we have the tools to do it in CL, even if you just want to catch students and redirect them. If numericValue started out as restrictive as many (including me) thought it should be, it seems harder to allow more freedom.

---

<div class="post-metadata">

### Author: ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)
#### Post date: [May 14, 2021, 5:33am UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/15 "2021-05-14T05:33:49Z")

</div>

I frequently have students enter more than just a numeric answer when I’ve asked questions with math inputs (even when I’ve entered a suffix), so this has been useful for me in many instances.

---

<div class="post-metadata">

### Author: ![Mike\_Gleeson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mike_gleeson/32/650_2.png) [@Mike\_Gleeson](https://cl.desmos.com/u/Mike_Gleeson)
#### Post date: [May 14, 2021, 11:46am UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/16 "2021-05-14T11:46:57Z")

</div>

It’s certainly useful but it’s also inconsistent, which ultimately is confusing both for the student and teacher(i’m thinking in terms of correctness).

Suppose one student enters: `1°`. Another student enters `1degree`.  
Desmos will accept the second answer as ok but not the first.  
And of course if a student tries something that Desmos does not handle well, like `pints`, it _will_ really confuse the student.

The other more subtle aspect is that SI units must have a space between the number and the unit delimiter(so for example `40 m` is correct but `40m` is not) precisely because placing the number adjacent to the unit symbol implies a product, mathematically. When we’re writing things out textually it’s not a big deal but since the field type is latex, this actually is a big deal.

Finally I’m going to take issue with Jay’s argument about false positives being the lesser of two evils. What if one student enters `1 m` and another enters `1 km`? Are we really saying they’re equal and that that’s better than marking them wrong and having a discussion as to why?

I understand why Desmos has gone down this road, and logistically it might be easier to just give this stuff a pass in the classroom when you’re busy helping a number of kids, but I just can’t agree.

---

<div class="post-metadata">

### Author: ![Jennifer\_Meikrantz](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_meikrantz/32/1338_2.png) [@Jennifer\_Meikrantz](https://cl.desmos.com/u/Jennifer_Meikrantz)
#### Post date: [May 14, 2021, 11:58am UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/17 "2021-05-14T11:58:13Z")

</div>

Standing ovation - YES! This is exactly what I was trying to convey. Thank you!

---

<div class="post-metadata">

### Author: ![SeanMaths4EAL](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/seanmaths4eal/32/289_2.png) [@SeanMaths4EAL](https://cl.desmos.com/u/SeanMaths4EAL)
#### Post date: [May 15, 2021, 6:57am UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/18 "2021-05-15T06:57:35Z")

</div>

Because it’s formatted as math, it also uses a math “italic”, not upright, font for that text.

Metric units must be upright font.  
3 km  
is a valid metric measurement  
_3 km_  
is not.

---

<div class="post-metadata">

### Author: ![jhiggins](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jhiggins/32/2060_2.png) [@jhiggins](https://cl.desmos.com/u/jhiggins)
#### Post date: [May 18, 2021, 5:13pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/19 "2021-05-18T17:13:35Z")

</div>

I recognize the reasoning of both parties here, but I have to agree that a numericValue correctness check should be cognizant of excess letters even if some units may be loosely represented in this way.

However, a truly useful feature would be a Math Input that allows for students to enter in their own unit suffix. (I understand some here use a separate multiple choice or text input to allow this but such workarounds are sometimes unwieldy for students. And unwieldy risks a loss of engagement.) Or at the very least, having the suffix snap closer to the input value visually.

---

<div class="post-metadata">

### Author: ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)
#### Post date: [May 18, 2021, 7:35pm UTC](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252/20 "2021-05-18T19:35:12Z")

</div>

I occasionally ponder being able to choose right alignment for inputs (instead of “snapping” to the suffix).

[Next page](https://cl.desmos.com/t/why-does-it-accept-letters-after-number-in-math-input/3252.md?page=2)
