[GRASS-SVN] r37729 -
grass/branches/releasebranch_6_4/gui/tcltk/gis.m
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jun 3 23:01:07 EDT 2009
Author: hamish
Date: 2009-06-03 23:01:07 -0400 (Wed, 03 Jun 2009)
New Revision: 37729
Modified:
grass/branches/releasebranch_6_4/gui/tcltk/gis.m/mapcanvas.tcl
Log:
trim unused zeros from resolution string (merge from devbr6)
Modified: grass/branches/releasebranch_6_4/gui/tcltk/gis.m/mapcanvas.tcl
===================================================================
--- grass/branches/releasebranch_6_4/gui/tcltk/gis.m/mapcanvas.tcl 2009-06-04 02:59:43 UTC (rev 37728)
+++ grass/branches/releasebranch_6_4/gui/tcltk/gis.m/mapcanvas.tcl 2009-06-04 03:01:07 UTC (rev 37729)
@@ -115,7 +115,7 @@
# proj_is_ll is 1 for a Lat/Lon projection, 0 otherwise
global proj_is_ll
- # DMS format: 0 is ddd.ddddd, 1 is ddd:mm.mmmmm', 2 is ddd:mm'ss.sss"
+ # DMS format: 0 is ddd.dddddd, 1 is ddd:mm.mmmm', 2 is ddd:mm'ss.sss"
global dms_format
# string with region information to show in status bar
@@ -183,6 +183,7 @@
}
# FIXME: make this settable from the UI or use GRASS_DMS_FORMAT enviro var
+ # DMS format: 0 is ddd.dddddd, 1 is ddd:mm.mmmm', 2 is ddd:mm'ss.sss"
set dms_format 2
# Make sure that we are using the WIND file for everything except displays
@@ -1108,7 +1109,11 @@
set res_str [format "%.6g" $res]
}
1 {
- set res_str [format "%.0f\xB0%02.4g'" $deg_d $min_f ]
+ if { $min_f == 0 } {
+ set res_str [format "%.0f\xB0" $deg_d ]
+ } else {
+ set res_str [format "%.0f\xB0%02.4g'" $deg_d $min_f ]
+ }
}
2 {
# 'g.region -g' doesn't report enough sig digs for LL so we get rounding errors!
@@ -1117,8 +1122,13 @@
set sec_f "0"
}
- set res_str [format "%.0f\xB0%02.0f'%02.3g\"" \
- $deg_d $min_d $sec_f ]
+ if { $sec_f != 0 } {
+ set res_str [format "%.0f\xB0%02.0f'%02.3g\"" $deg_d $min_d $sec_f ]
+ } elseif { $min_d != 0 } {
+ set res_str [format "%.0f\xB0%02.0f'" $deg_d $min_d ]
+ } else {
+ set res_str [format "%.0f\xB0" $deg_d ]
+ }
}
}
More information about the grass-commit
mailing list