# Get help debugging code. Want to get round the displayed number in an app to 2 decimal places

**URL:** <https://forum.code.org/t/get-help-debugging-code-want-to-get-round-the-displayed-number-in-an-app-to-2-decimal-places/41925>\
**Category:** Coding and Debugging Help\
**Created:** [April 23, 2026, 1:36am UTC](https://forum.code.org/t/get-help-debugging-code-want-to-get-round-the-displayed-number-in-an-app-to-2-decimal-places/41925 "2026-04-23T01:36:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jurbanek](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jurbanek](https://forum.code.org/u/jurbanek)\
**Post date:** [April 23, 2026, 1:36am UTC](https://forum.code.org/t/get-help-debugging-code-want-to-get-round-the-displayed-number-in-an-app-to-2-decimal-places/41925/1 "2026-04-23T01:36:43Z")

</div>

Need help to have the display discounted price rounded to two decimal places. I see the rounded number in the console.log but not on the Apps display screen.

**Link to the project or level:** [[replace with link to the curriculum or get the “Share” link to a project]](https://studio.code.org/projects/applab/a7745829-6bc5-4f10-a1cc-04c28b603106)  
**What I expect to happen:** [Displayed discount will be rounded to two decimal places. I see the rounded number in the console log, but on the test display on the app.]  
**What actually happens:** [Rounds to two decimal places in console log, but not in the display text area.]  
**What I’ve tried:** []

---

<div class="post-metadata">

**Author:** ![Paprika](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/paprika/32/9777_2.png) [@Paprika](https://forum.code.org/u/Paprika)\
**Post date:** [April 23, 2026, 5:20pm UTC](https://forum.code.org/t/get-help-debugging-code-want-to-get-round-the-displayed-number-in-an-app-to-2-decimal-places/41925/2 "2026-04-23T17:20:30Z")

</div>

The simplest fix i found was changing line 12 to mimic the console.log  
code: `setText("discp", discp.toFixed(2));`  
Changing this shows the discount price as rounded. I will also suggest changing text\_area2 and text\_area1 to read only in the design tab so the text cannot be edited while running the app.
