# How to limit decimal places when using Show Number with a float?

**URL:** https://forum.makecode.com/t/how-to-limit-decimal-places-when-using-show-number-with-a-float/1012
**Category:** micro:bit
**Created:** [January 9, 2020, 7:36pm UTC](https://forum.makecode.com/t/how-to-limit-decimal-places-when-using-show-number-with-a-float/1012 "2020-01-09T19:36:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ShawnHymel](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@ShawnHymel](https://forum.makecode.com/u/ShawnHymel)
#### Post date: [January 9, 2020, 7:36pm UTC](https://forum.makecode.com/t/how-to-limit-decimal-places-when-using-show-number-with-a-float/1012/1 "2020-01-09T19:36:28Z")

</div>

I’m trying to display a floating point value on the micro:bit’s screen. When I use the Show Number block after performing a division operation (e.g. (analog read pin P0) x 3 / 1023 ), the screen scrolls something like 12 decimal places. Is there a way I can round or truncate the decimal places to something more reasonable (e.g. 2 places)?

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [January 10, 2020, 3:54pm UTC](https://forum.makecode.com/t/how-to-limit-decimal-places-when-using-show-number-with-a-float/1012/2 "2020-01-10T15:54:49Z")

</div>

Hummm… I taught we did this automatically. What is your code?

---

<div class="post-metadata">

### Author: ![ShawnHymel](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@ShawnHymel](https://forum.makecode.com/u/ShawnHymel)
#### Post date: [January 10, 2020, 5:01pm UTC](https://forum.makecode.com/t/how-to-limit-decimal-places-when-using-show-number-with-a-float/1012/3 "2020-01-10T17:01:20Z")

</div>

This is what I’m using: [https://makecode.microbit.org/\_b9i2Yd5YkVqe](https://makecode.microbit.org/_b9i2Yd5YkVqe)

---

<div class="post-metadata">

### Author: ![mmoskal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mmoskal/32/20_2.png) [@mmoskal](https://forum.makecode.com/u/mmoskal)
#### Post date: [January 23, 2020, 6:43am UTC](https://forum.makecode.com/t/how-to-limit-decimal-places-when-using-show-number-with-a-float/1012/4 "2020-01-23T06:43:44Z")

</div>

Can you report a bug in pxt microbit github and at mention me? Thanks.

---

<div class="post-metadata">

### Author: ![ShawnHymel](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@ShawnHymel](https://forum.makecode.com/u/ShawnHymel)
#### Post date: [February 5, 2020, 2:35am UTC](https://forum.makecode.com/t/how-to-limit-decimal-places-when-using-show-number-with-a-float/1012/5 "2020-02-05T02:35:55Z")

</div>

Done! [https://github.com/microsoft/pxt-microbit/issues/2598](https://github.com/microsoft/pxt-microbit/issues/2598)

It looks like some other people are having a similar issue…feel free to mark as duplicate.
