no digits after decimal point

hello all from a newcomer. i am reading an analog input on A0. it comes from a pot and represents direction. the result(0 to 1023) is divided by 2.841 ie. 1023/360 degrees.it works fine but the numbers after the decimal point are meaningless so i dont need them. i have reaaly tried.

Can't see your code.

Hello and welcome

Use function round() to round a float to nearest whole value, then cast to an int.

int intVal = (int)round( floatVal );

Edit: also have a look at the function map()

i am running "analog read serial" which is pre written by others

Can we please at least have a clue as to what that means ?
Better still, let's see the program.

i am running "analog read serial" which is pre written by others

I don't see 2.841 in that sketch.

Please don't make us hunt for your code.
"Always" attach you code using the </> icon in the posting menu.

// read the input on analog pin 0:

// print out the value you read:
Serial.println(sensorValue);/2.8416);
delay(2000); // delay in between reads for stability
} new to the forum too hope this works

BTW I am displaying it on a monitor ( for now)

sorry, i am trying to get used to Arduino and also the forum. here is the complete code

/*
 AnalogReadSerial
  Reads an analog input on pin 0, prints the result to the serial monitor.
  Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

 This example code is in the public domain.
 */

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue/2.481);
  delay(2000);        // delay in between reads for stability
}
/*
 AnalogReadSerial
  Reads an analog input on pin 0, prints the result to the serial monitor.
  Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

 This example code is in the public domain.
 */

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue * 0.3519, 0);
  delay(2000);        // delay in between reads for stability
}

joemurphy:
the result(0 to 1023) is divided by 2.841 ie. 1023/360 degrees.

Sounds like you need the map() function.

http://www.arduino.cc/en/Reference/Map

This can be rearranged with simple arithmetic.

Instead of dividing by 1023/360, try multiplying by 360/1023.

int angle = (sensorValue * 360L) / 1023;

Just so you know: the "L" after the 360 is because an int cannot hold numbers larger than 32767. If you try to multiply, for example, 200 by 360, you will get a garbage answer (6464 instead of 72000) unless you use a larger datatype such as a long. The "L" after the "360" tells the compiler that you want it treated as a long.