# Set number of digits for a variable

**URL:** <https://forum.kirupa.com/t/set-number-of-digits-for-a-variable/277917>\
**Category:** Uncategorized\
**Created:** [December 18, 2008, 7:28pm UTC](https://forum.kirupa.com/t/set-number-of-digits-for-a-variable/277917 "2008-12-18T19:28:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobbyO](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bobbyO](https://forum.kirupa.com/u/bobbyO)\
**Post date:** [December 18, 2008, 7:28pm UTC](https://forum.kirupa.com/t/set-number-of-digits-for-a-variable/277917/1 "2008-12-18T19:28:02Z")

</div>

I want to display:

```auto

spdDisplay.text = String(angle/2.1);

```

but I want it to always display 2 decimal places always. No more, no less.  
Can anyone help me out with this?
