]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Extend Utilities::int_to_string to up to 10 digits.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 5 Jan 2013 12:12:16 +0000 (12:12 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 5 Jan 2013 12:12:16 +0000 (12:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@27931 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/utilities.cc

index 23834cd530c0bba70eb3e4defbcf8d0220a68be9..3b0f832fc88945535756035dd659ad7856983b56 100644 (file)
@@ -2,7 +2,7 @@
 //      $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011, 2012 by the deal.II authors
+//    Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -82,12 +82,24 @@ namespace Utilities
                      (digits==3 && i>=1000) ||
                      (digits==4 && i>=10000)||
                      (digits==5 && i>=100000)||
-                     (i>=1000000)),
+                    (digits==6 && i>=1000000)||
+                     (digits==7 && i>=10000000)||
+                     (digits==8 && i>=100000000)||
+                    (digits==9 && i>=1000000000)||
+                     (i>=1000000000)),
                   ExcInvalidNumber2StringConversersion(i, digits));
 
     std::string s;
     switch (digits)
       {
+      case 10:
+        s += '0' + i/1000000000;
+      case 9:
+        s += '0' + i/100000000;
+      case 8:
+        s += '0' + i/10000000;
+      case 7:
+        s += '0' + i/1000000;
       case 6:
         s += '0' + i/100000;
       case 5:

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.