Revision: 1529
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1529&view=rev
Author:   cimorrison
Date:     2010-10-22 08:41:07 +0000 (Fri, 22 Oct 2010)

Log Message:
-----------
Fixed bug whereby integer durations (eg 10 hours) were having trailing zeros 
stripped

Modified Paths:
--------------
    mrbs/branches/from_to_bookings/web/Themes/default/header.inc

Modified: mrbs/branches/from_to_bookings/web/Themes/default/header.inc
===================================================================
--- mrbs/branches/from_to_bookings/web/Themes/default/header.inc        
2010-10-21 17:02:54 UTC (rev 1528)
+++ mrbs/branches/from_to_bookings/web/Themes/default/header.inc        
2010-10-22 08:41:07 UTC (rev 1529)
@@ -248,19 +248,21 @@
 
   function durFormat(r)
   {
-
     r = r.toFixed(2);
     r = parseFloat(r);
     r = r.toLocaleString();
 
-    while (r.substr(r.length -1) == '0')
+    if ((r.indexOf('.') >= 0) || (r.indexOf(',') >= 0))
     {
-      r = r.substr(0, r.length - 1);
-    }
+      while (r.substr(r.length -1) == '0')
+      {
+        r = r.substr(0, r.length - 1);
+      }
 
-    if ((r.substr(r.length -1) == '.') || (r.substr(r.length -1) == ','))
-    {
-      r = r.substr(0, r.length - 1);
+      if ((r.substr(r.length -1) == '.') || (r.substr(r.length -1) == ','))
+      {
+        r = r.substr(0, r.length - 1);
+      }
     }
     
     return r;
@@ -412,6 +414,7 @@
       }
     }
     
+    
   }
 <?php
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to