added AppendNumberToString() method
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Sep 2000 11:51:50 +0000 (11:51 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Sep 2000 11:51:50 +0000 (11:51 +0000)
TGeant4/TG4Globals.cxx

index cdc05cf..1a99807 100644 (file)
@@ -38,3 +38,22 @@ void TG4Globals::Warning(const char* string)
   {  G4cerr  << "    " << string << G4endl; }
   G4cerr << "+++++++++++++++++++++++" << G4endl;   
 }
+
+void TG4Globals::AppendNumberToString(G4String& s, G4int a)
+{
+// Appends number to string.
+// ---
+
+  const char* kpNumber="0123456789";
+  G4String p=""; G4String q="";
+  do 
+  {
+    G4int b=a/10;
+    G4int c=a%10;
+    p=kpNumber[c];
+    q=p.append(q);
+    a=b;        
+  } while (a>0);
+  s.append(q);
+}
+