# RainbowHat 'display.print\_float()' no decimal places

**URL:** <https://forums.pimoroni.com/t/rainbowhat-display-print-float-no-decimal-places/4121>\
**Category:** Support\
**Created:** [March 2, 2017, 12:59pm UTC](https://forums.pimoroni.com/t/rainbowhat-display-print-float-no-decimal-places/4121 "2017-03-02T12:59:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![remote\_python](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@remote\_python](https://forums.pimoroni.com/u/remote_python)\
**Post date:** [March 2, 2017, 12:59pm UTC](https://forums.pimoroni.com/t/rainbowhat-display-print-float-no-decimal-places/4121/1 "2017-03-02T12:59:39Z")

</div>

I’m not sure what I’m doing wrong, the temperature value I want is displaying, just not anything after the decimal point.

So if the temperature is 16.94, I’m seeing two blanks and 16 over to the right.

The code is:

```
    cpuTemp=int(float(getCPUtemperature()))  
    ambient = rainbowhat.weather.temperature()

    calctemp = ambient - ((cpuTemp - ambient)/ 0.65)

# calctemp = float("{0:.2f}".format(calctemp))

    rainbowhat.display.print_float(calctemp)
    rainbowhat.display.show()

```

I’ve tried formating the temperature but that doesn’t display it either, what am I missing?

---

<div class="post-metadata">

**Author:** ![sandyjmacdonald](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/sandyjmacdonald/32/393_2.png) [@sandyjmacdonald](https://forums.pimoroni.com/u/sandyjmacdonald)\
**Post date:** [March 5, 2017, 10:13pm UTC](https://forums.pimoroni.com/t/rainbowhat-display-print-float-no-decimal-places/4121/2 "2017-03-05T22:13:05Z")

</div>

That’s a strange one! I’ll try running that code tomorrow, and get to the bottom of it.
