# Taking Math Input an rounding it to 2 decimal places to use in CL text

**URL:** https://cl.desmos.com/t/taking-math-input-an-rounding-it-to-2-decimal-places-to-use-in-cl-text/2607
**Category:** Questions
**Created:** [February 8, 2021, 3:26pm UTC](https://cl.desmos.com/t/taking-math-input-an-rounding-it-to-2-decimal-places-to-use-in-cl-text/2607 "2021-02-08T15:26:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Richard\_Armstrong](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/richard_armstrong/32/1675_2.png) [@Richard\_Armstrong](https://cl.desmos.com/u/Richard_Armstrong)
#### Post date: [February 8, 2021, 3:26pm UTC](https://cl.desmos.com/t/taking-math-input-an-rounding-it-to-2-decimal-places-to-use-in-cl-text/2607/1 "2021-02-08T15:26:39Z")

</div>

I am trying to give students feedback in an activity through CL text. Some of the questions require that students input their answers as fractions, but I want to limit my feedback ouput to just 4 decimal places. How can I code this?

Here is an example of my code:

content: “{question} {feedback}” (note: missing strings are really there in the code)

question = "A recent survey of American adults found that 638 of 840 have a favorable opinion of the current presidential administration. Develop a confidence interval for the actual proportion of American adults that have a favorable opinion of the administration.

What is the sample proportion `\hat{p}`?"

answerlow = 0.75  
answerhigh = 0.761

feedback =  
when Input21.submitted and Input21.numericValue\< answerhigh and Input21.numericValue\> answerlow “\n\n\n✅Good job. ${Input21.numericValue} is correct.”

when Input21.submitted “\n\n\n❌ Nope. Remember, we are now looking for a sample proportion. This is simply the number of adults who approve of the president divided by the number that were asked.”  
otherwise “”

I want the output for the correct answer “\n\n\n✅Good job. ${Input21.numericValue} is correct.” to be limited to a certain number of decimal places (in this case 3). How can I make this happen?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![Susan\_Lauer](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/susan_lauer/32/1832_2.png) [@Susan\_Lauer](https://cl.desmos.com/u/Susan_Lauer)
#### Post date: [February 8, 2021, 4:36pm UTC](https://cl.desmos.com/t/taking-math-input-an-rounding-it-to-2-decimal-places-to-use-in-cl-text/2607/2 "2021-02-08T16:36:36Z")

</div>

In the Note CL, you can round defined constant numbers, your numbers, or input like this:

```auto
n1 = numericValue(`\round(\pi,2)`)
n2 = numericValue(`\round(.0123456,4)`)
n3 = numericValue(`\round(${Input21.numericValue},4)`) 
content: "this is ${n1} \nand this is another number: ${n2} \nand for 638/840: ${n3}"

```

And it will look like this:  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/3/333a2ac6d155ee4b8387ca2a2972648992593606.png)

---

<div class="post-metadata">

### Author: ![Richard\_Armstrong](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/richard_armstrong/32/1675_2.png) [@Richard\_Armstrong](https://cl.desmos.com/u/Richard_Armstrong)
#### Post date: [February 8, 2021, 5:49pm UTC](https://cl.desmos.com/t/taking-math-input-an-rounding-it-to-2-decimal-places-to-use-in-cl-text/2607/3 "2021-02-08T17:49:19Z")

</div>

Thanks. That works like a champ!
