OSSP CVS Repository

ossp - Difference in ossp-pkg/as/as-gui/as_amount.cpp versions 1.2 and 1.3
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/as/as-gui/as_amount.cpp 1.2 -> 1.3

--- as_amount.cpp        2002/11/26 19:33:36     1.2
+++ as_amount.cpp        2002/11/26 23:26:07     1.3
@@ -25,13 +25,15 @@
 // Return a text formatted representation
 QString AmountBox::text(void) const
 {
-    QString Strout;
+    QString Strfirst, Strsecond;
     int nHours = 0;
     int nMins = this->value();
 
-    nHours = nMins / TITRAQ_MINSINHOUR;    // Calculate total hours
-    nMins  = nMins % TITRAQ_MINSINHOUR;    // Calculate total minutes
-    Strout = trUtf8("%1:%2").arg(nHours).arg(nMins); // Format string
+    nHours    = nMins / TITRAQ_MINSINHOUR;      // Calculate total hours
+    nMins     = nMins % TITRAQ_MINSINHOUR;      // Calculate total minutes
+    Strfirst  = trUtf8("%1:").arg(nHours);      // Format the first part
+    Strsecond = trUtf8("%1").arg(nMins);        // Format the second part
 
-    return Strout;
+    // Pad the resulting concatination before sending it out the back
+    return Strfirst.rightJustify(3, '0') + Strsecond.rightJustify(2, '0');
 }

CVSTrac 2.0.1