public FormattingResult roundDistanceMetric(int meters) {
        int absmeters = Math.abs(meters);
        boolean longdistance = false;
        StringBuffer sb = new StringBuffer(15); // "-2000000000"
        
        if ( absmeters < 10){
            // no rounding
            sb.append(absmeters);
        } else if ( absmeters < 100 ) {
            // round to 5 m
            sb.append(WFMath.roundTo(absmeters, 5));
        } else if (absmeters + 5 < 1000 ) {
            // round to 10 m - thus usually 2 digits of precision: 890 m  
            sb.append(WFMath.roundTo(absmeters, 10));
        } else if (absmeters + 50 < 10000 ) {
            // round to 100m, use km - thus usually 2 digits of precision: 1.2 km 
                int hektometers = WFMath.roundTo(absmeters, 100) / 100;
                sb.append(hektometers / 10);
                sb.append(m_config.getDecimalMarker());
                sb.append(hektometers % 10);
                longdistance = true;
        } else {
            // rounded whole km
            sb.append(WFMath.roundTo(absmeters, 1000) / 1000);
            longdistance = true;
        }

        if (meters < 0) {
            sb.insert(0, '-');
        }

        return FormattingResult.createForDistance(m_config,
                sb.toString(),
                longdistance);
    }