From 697aaadc5242c6714491b253fe41f676729474b8 Mon Sep 17 00:00:00 2001
From: Jacques Grelet <jacques.grelet@ird.fr>
Date: Wed, 21 Nov 2007 20:46:13 +0000
Subject: [PATCH] =?UTF-8?q?fonction=20MouseMotion:=20Utilise=20sprintf=20a?=
 =?UTF-8?q?u=20lieu=20de=20strcat.=20Am=C3=A9liore=20le=20rendu=20mais=20l?=
 =?UTF-8?q?e=20format=20+07.4f=20ne=20marche=20pas.=20Utiliser=20plusieurs?=
 =?UTF-8?q?=20uicontrol=20a=20la=20place.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 tsgqc_GUI.m | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tsgqc_GUI.m b/tsgqc_GUI.m
index 1fd806a..91bbbd7 100644
--- a/tsgqc_GUI.m
+++ b/tsgqc_GUI.m
@@ -580,14 +580,16 @@ function tsgqc_GUI
             if x > tsg.TIME(1) && x < tsg.TIME(end)
             
                 indCursor = find( tsg.TIME > x);
-                
+                % use sprintf with format instead strcat & num2str but flag
+                % - don't work with 0, eg %+07.4f
                 set( hInfoText, 'String',...
-                strcat(...
-                datestr(tsg.TIME(indCursor(1)),'dd mmmm yyyy'),...
-                '  -  Latitute = ', num2str(tsg.LATITUDE(indCursor(1))), ...
-                '  -  Longitude = ', num2str(tsg.LONGITUDE(indCursor(1))), ...
-                '  -  Salinity = ', num2str(tsg.PSAL(indCursor(1))), ...
-                '  -  Temperature = ', num2str(tsg.TEMP_TSG(indCursor(1)))...
+                  sprintf(['%s  -  Latitude = %07.4f  -  Longitude = %08.4f '...
+                           ' -  Salinity = %07.4f  -  Temperature = %07.4f'],...
+                    datestr(tsg.TIME(indCursor(1)),'dd/mm/yyyy'),...
+                    tsg.LATITUDE(indCursor(1)), ...
+                    tsg.LONGITUDE(indCursor(1)), ...
+                    tsg.PSAL(indCursor(1)), ...
+                    tsg.TEMP_TSG(indCursor(1))...
                 ));
             
                % Plot the position on the map if this one is active
-- 
GitLab