Error removing decimal places

Hi all

Hope someone can share a little info as to why I`m running into this little issue.

So this is my first venture into ESP32, I just copied my old Arduino code across and it works great, just a BME280 temp and humidity sensor and an Oled display, easy.

The code below just works, however on the temperature side I don’t want the extra decimal places, so in my old Arduino code I just add a 0 in the code line

display.print(bme280.getTemperature, 0);

But if I use this modified line to remove the extra decimal places in this ESP32 code I get the following error

“invalid use of non-static member function”

Any thoughts on how to get rid of this error and the extra decimals would be great.

Cheers Alan

#include "Seeed_BME280.h"
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
BME280 bme280;

void setup()
{
  Serial.begin(9600);
  bme280.init();
  display.begin(SSD1306_SWITCHCAPVCC, 0x3c);
  display.display();
  display.clearDisplay();
}

void loop()
{
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0, 10);
  display.print("Humi:");
  display.print(bme280.getHumidity());
  display.print("%");

  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0, 40);
  display.print("Temp:");
  display.print(bme280.getTemperature());
  display.print("c");
  display.display();

  delay(2000);
  display.clearDisplay();

}

display.print(bme280.getTemperature(),0);

Your an absolute star, cheers man :slight_smile: