>>871

long f(long data) {
return (long)( round(data/1000.0)*1000);
}