Whenever I send any value to the serial monitor, it returns the value I sent, as well as the value for the return key. It does this when I press enter to send the data, or when I click send, it doesn't matter. How do I prevent this because it prevents me from using the serial monitor to control my Arduino functions? My code is pasted below, and I have attached a jpg of the serial monitor data. When you look at the serial monitor data, the first value it prints is the value I typed, then immediately after it prints -38, the enter key/send button. Any help is appreciated, thanks.
I am working with an Arduino Uno and am running Arduino IDE 1.8.9 on Mac OS Mojave.
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available())
{
Serial.println(Serial.read()-48); // Print actual value of digit (0-9) sent from serial monitor
}
}