Changeset 5565 in josm for trunk


Ignore:
Timestamp:
2012-11-04T13:19:13+01:00 (12 years ago)
Author:
Don-vip
Message:

see #8153 - fix area computation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r5560 r5565  
    12441244         */
    12451245        public String getAreaText(double area) {
    1246             return getDistText(area)+"\u00b2"; // square
     1246            double a = area / (aValue*aValue);
     1247            if (!Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false) && a > bValue / aValue) {
     1248                double b = area / (bValue*bValue);
     1249                return String.format(Locale.US, "%." + (b<10 ? 2 : 1) + "f %s", b, bName+"\u00b2");
     1250            } else if (a < 0.01)
     1251                return "< 0.01 " + aName;
     1252            else
     1253                return String.format(Locale.US, "%." + (a<10 ? 2 : 1) + "f %s", a, aName+"\u00b2");
    12471254        }
    12481255    }
Note: See TracChangeset for help on using the changeset viewer.