*/
std::string
int_to_string (const unsigned int i,
- const unsigned int digits);
+ const unsigned int digits = deal_II_numbers::invalid_unsigned_int);
/**
* Determine how many digits are needed to
int_to_string (const unsigned int i,
const unsigned int digits)
{
+ // if second argument is invalid, then do
+ // not pad the resulting string at all
+ if (digits == deal_II_numbers::invalid_unsigned_int)
+ return int_to_string (i, needed_digits(i));
+
+
AssertThrow ( ! ((digits==1 && i>=10) ||
(digits==2 && i>=100) ||
(digits==3 && i>=1000) ||
<h3>base</h3>
<ol>
+ <li> <p> New: The second argument to <code>Utilities::int_to_string</code>
+ can now be omitted, leading to a string that isn't zero padded at all.
+ <br>
+ (WB 2006/08/02)
+ </p>
+
<li> <p> Changed: When there is still a <code>SmartPointer</code> object
pointing to another object at the time it is destroyed, this would cause
the program to be aborted. However, there are cases where this is not
// $Id$
// Version: $Name$
//
-// Copyright (C) 2005 by the deal.II authors
+// Copyright (C) 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
void test ()
{
deallog << Utilities::int_to_string (42,4) << std::endl;
+ deallog << Utilities::int_to_string (42) << std::endl;
deallog << Utilities::needed_digits (424) << std::endl;
deallog << Utilities::string_to_int (" 413 ") << std::endl;
DEAL::0042
+DEAL::42
DEAL::3
DEAL::413
DEAL::1