# Show given number of significant numbers of float in text()

**URL:** <https://discourse.processing.org/t/show-given-number-of-significant-numbers-of-float-in-text/19603>\
**Category:** Coding Questions\
**Created:** [April 10, 2020, 1:37am UTC](https://discourse.processing.org/t/show-given-number-of-significant-numbers-of-float-in-text/19603 "2020-04-10T01:37:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juanjoc](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@juanjoc](https://discourse.processing.org/u/juanjoc)\
**Post date:** [April 10, 2020, 1:37am UTC](https://discourse.processing.org/t/show-given-number-of-significant-numbers-of-float-in-text/19603/1 "2020-04-10T01:37:21Z")

</div>

Hi everyone. I want to show a float number in a text, but it show like 4 significant numbers.

```auto
float number = 1;
void setup()
{
  background(0);
  size(100,100);
}
void draw()
{
  fill(255);
  text(number,50,50);
  delay(500);
}

```

it show 4 zeros. but i want only 2 or 3 or what i want. How can i code that?

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [April 10, 2020, 2:19am UTC](https://discourse.processing.org/t/show-given-number-of-significant-numbers-of-float-in-text/19603/2 "2020-04-10T02:19:47Z")

</div>

Sounds like you’re looking for the `nf()` function?

[https://p5js.org/reference/#/p5/nf](https://p5js.org/reference/#/p5/nf)

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [April 10, 2020, 8:40am UTC](https://discourse.processing.org/t/show-given-number-of-significant-numbers-of-float-in-text/19603/3 "2020-04-10T08:40:28Z")

</div>

Hello,

The Processing page has a list of references:  
[https://processing.org/reference/](https://processing.org/reference/)

The Processing PDE (IDE) also has a list of references; check out the tabs on top to find these.

Check out the ones in the Data \> String Functions sections and choose wisely.

`:)`
